Commit fcc8f22
committed
Handle multiline options
Clean up options expecting lists before using them, as they may contain
newlines.
Examples:
* Enclosing command-line arguments in quotes may introduce newlines in
option values:
$ codespell -S "A, B,
> C, D, E"
* INI files may contain multiline values:
[codespell]
skip = A, B,
C, D, E,
In all the above cases, the option parsing mechanism keeps the newlines
(and spaces). We need to clean up, by splitting on commas and stripping
each resulting item from newlines (and spaces).1 parent a5c8237 commit fcc8f22
1 file changed
+24
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
| 163 | + | |
| 164 | + | |
170 | 165 | | |
171 | 166 | | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
176 | 172 | | |
177 | 173 | | |
178 | 174 | | |
| |||
1109 | 1105 | | |
1110 | 1106 | | |
1111 | 1107 | | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
1112 | 1124 | | |
1113 | 1125 | | |
1114 | 1126 | | |
| |||
1256 | 1268 | | |
1257 | 1269 | | |
1258 | 1270 | | |
1259 | | - | |
| 1271 | + | |
1260 | 1272 | | |
1261 | 1273 | | |
1262 | 1274 | | |
| |||
0 commit comments