Improvement for splitting settings variables
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Ambito
- tooling
Direzione di ricerca
Inizia riproducendo gli esempi con SplitTooLongLine e AlignVariablesSection, inclusi fixed_width e le variabili divise manualmente. Traccia il modo in cui questi formattatori gestiscono le righe di continuazione di Variables-section; il lavoro è completato quando le variabili lunghe e corte usano un allineamento coerente e leggibile, senza l'indentazione in conflitto mostrata nel report.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I would like to split and intend following lines:
*** Variables ***
${VARIABLE} = High
@{VARIABLE_LIST} = High High, Med High, Med,\nLow High, Med,\\nLow
@{SHORT_LIST} = valuevalue valuevaluevalue valuevaluevalue
&{SHORT_DICT} = name=John Doe age=12 hobby=coding
@{VERY_LONG_VARIABLE_NAME_CONTAINING_FRUITS} = apple banana pineapple tomato
@{OVER_LONG_LIST} = valuevaluevaluevaluevalue valuevaluevaluevaluevalue valuevaluevaluevaluevalue valuevaluevaluevaluevalue valuevaluevaluevaluevalue valuevaluevaluevaluevalue
&{OVER_LONG_DICT} = name=John Doe age=12 hobby=coding age=12 hobby=coding age=12 hobby=coding age=12 hobby=coding
into something like this:
*** Variables ***
${VARIABLE} = High
@{VARIABLE_LIST} = High High, Med High, Med,\nLow High, Med,\\nLow
@{SHORT_LIST} = valuevalue valuevaluevalue valuevaluevalue
&{SHORT_DICT} = name=John Doe age=12 hobby=coding
@{VERY_LONG_VARIABLE_NAME_CONTAINING_FRUITS} =
... apple banana pineapple tomato
@{OVER_LONG_LIST} = valuevaluevaluevaluevalue valuevaluevaluevaluevalue valuevaluevaluevaluevalue
... valuevaluevaluevaluevalue valuevaluevaluevaluevalue valuevaluevaluevaluevalue
&{OVER_LONG_DICT} = name=John Doe age=12 hobby=coding age=12 hobby=coding age=12 hobby=coding age=12
... hobby=coding
With following configuration: defaults +
"SplitTooLongLine:skip_comments=True:split_on_every_arg=False:split_on_every_setting_arg=False:split_on_every_value=False"
I get this:
${VARIABLE} = High
@{VARIABLE_LIST} = High High, Med High, Med,\nLow High, Med,\\nLow
@{SHORT_LIST} = valuevalue valuevaluevalue valuevaluevalue
&{SHORT_DICT} = name=John Doe age=12 hobby=coding
@{VERY_LONG_VARIABLE_NAME_CONTAINING_FRUITS} = apple banana pineapple tomato
@{OVER_LONG_LIST} = valuevaluevaluevaluevalue valuevaluevaluevaluevalue valuevaluevaluevaluevalue
... valuevaluevaluevaluevalue valuevaluevaluevaluevalue valuevaluevaluevaluevalue
&{OVER_LONG_DICT} = name=John Doe age=12 hobby=coding age=12 hobby=coding age=12 hobby=coding
... age=12 hobby=coding
Readable but lot of empty space. Also OVER_LONG_LIST & OVER_LONG_DICT are not aligned. To minimize that I'll use config:
"SplitTooLongLine:skip_comments=True:split_on_every_arg=False:split_on_every_setting_arg=False:split_on_every_value=False"
"AlignVariablesSection:fixed_width=4",
I get:
*** Variables ***
${VARIABLE} = High
@{VARIABLE_LIST} = High High, Med High, Med,\nLow High, Med,\\nLow
@{SHORT_LIST} = valuevalue valuevaluevalue valuevaluevalue
&{SHORT_DICT} = name=John Doe age=12 hobby=coding
@{VERY_LONG_VARIABLE_NAME_CONTAINING_FRUITS} = apple banana pineapple tomato
@{OVER_LONG_LIST} = valuevaluevaluevaluevalue valuevaluevaluevaluevalue valuevaluevaluevaluevalue
... valuevaluevaluevaluevalue valuevaluevaluevaluevalue valuevaluevaluevaluevalue
&{OVER_LONG_DICT} = name=John Doe age=12 hobby=coding age=12 hobby=coding age=12 hobby=coding
... age=12 hobby=coding
Now it become difficult to read.
I can manually split the line with long variable but rest of the lines are still quite unreadable:
@{VERY_LONG_VARIABLE_NAME_CONTAINING_FRUITS} =
... apple banana pineapple tomato
Removing AlignVariablesSection:fixed_width from config readability improves but that manually splitted line become awkward.
@{VERY_LONG_VARIABLE_NAME_CONTAINING_FRUITS} =
... apple banana pineapple tomato
I guess the reason why indentation is different between different variables (like OVER_LONG_LIST & OVER_LONG_DICT) is that they are formatted with SplitTooLongLine and other are formatted with AlignVariablesSection.
In my opinion, the formatting (splitting and aliging) should be done by same formatter so the aligning gets done the same way everywhere (mostly referring only to Settings and variables sections).
Other thing to mention.
If those OVER_LONG_LIST & OVER_LONG_DICT are manually splitted then they start to be formatted by AlignVariablesSection which means that if AlignVariablesSection:fixed_width is not set they become:
@{OVER_LONG_LIST} = valuevaluevaluevaluevalue
... valuevaluevaluevaluevalue valuevaluevaluevaluevalue
... valuevaluevaluevaluevalue
... valuevaluevaluevaluevalue valuevaluevaluevaluevalue
&{OVER_LONG_DICT} = name=John Doe age=12 hobby=coding
... age=12 hobby=coding age=12 hobby=coding
... age=12 hobby=coding
which is not what is wanted.
If AlignVariablesSection:fixed_width is set they become:
@{OVER_LONG_LIST} = valuevaluevaluevaluevalue
... valuevaluevaluevaluevalue valuevaluevaluevaluevalue
... valuevaluevaluevaluevalue
... valuevaluevaluevaluevalue valuevaluevaluevaluevalue
&{OVER_LONG_DICT} = name=John Doe age=12 hobby=coding
... age=12 hobby=coding age=12 hobby=coding
... age=12 hobby=coding
This is what is wanted but then the other variable lines becomes difficult to read.
In fact, also the lines above containing variables (like @{OVER_LONG_LIST} = valuevaluevaluevaluevalue) should be aligned with other lines having variable names.
- Lingua principale
- RobotFramework
- Stelle
- 113
- Fork
- 16
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di MarketSquare/robotframework-tidy
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
MarketSquare/robotframework-tidy#741 · 3 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
MarketSquare/robotframework-tidy#712 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
MarketSquare/robotframework-tidy#710 · 1 reazione ·
-
Enhancement request: RenameTestCases and RenameKeywords transformers to detect camelCase names.Apertaenhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
MarketSquare/robotframework-tidy#683 · 1 commento · 1 reazione ·
Tutte le issue di MarketSquare/robotframework-tidy
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
nikic/PHP-Parser#1187 ·
-
compiler
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
HerringtonDarkholme/hd-lang#1699 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
[workshop-sim] Repair: Make Copilot access and billing path decision self-contained in Steps 07/07dApertafeedback simulation workshop
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
githubnext/gh-aw-workshop#5597 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100