Commit 5dff0be
committed
scripts/visualize-builds.py: Satisfy ruff and pylint
scripts/visualize-builds.py:169:23: SIM115 Use a context manager for opening files
|
167 | output_file = None
168 | if args.output:
169 | output_file = open(args.output, "w", newline="")
| ^^^^ SIM115
170 |
171 | try:
|
scripts/visualize-builds.py:176:9: PLR5501 [*] Use `elif` instead of `else` then `if`, to reduce indentation
|
174 | elif args.format == "pretty":
175 | output_pretty_table(days, output_file)
176 | / else: # regular table
177 | | if (
| |____________^ PLR5501
178 | output_file
179 | ): # evil hack so I don't have to rewrite visualize_data() prints
|
= help: Convert to `elif`
Found 2 errors.
************* Module visualize-builds
scripts/visualize-builds.py:169:22: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
scripts/visualize-builds.py:169:22: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
Signed-off-by: Nathan Chancellor <[email protected]>1 parent e7d52ef commit 5dff0be
1 file changed
+12
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
168 | 170 | | |
169 | 171 | | |
170 | 172 | | |
171 | 173 | | |
172 | 174 | | |
173 | 175 | | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
184 | 185 | | |
185 | 186 | | |
186 | 187 | | |
| |||
0 commit comments