|
1 | 1 | #!/usr/bin/env python3
|
| 2 | +# ruff: noqa: ERA001 |
2 | 3 |
|
3 | 4 | import io
|
4 | 5 | import itertools
|
@@ -210,7 +211,7 @@ def _read_python_source(filename):
|
210 | 211 | Do our best to decode a Python source file correctly.
|
211 | 212 | """
|
212 | 213 | try:
|
213 |
| - f = open(filename, "rb") |
| 214 | + f = open(filename, "rb") # noqa: SIM115 |
214 | 215 | except OSError:
|
215 | 216 | return None, None
|
216 | 217 | try:
|
@@ -286,7 +287,7 @@ def visit_classdef(self, node):
|
286 | 287 | elif attr == "_inherits":
|
287 | 288 | val = literal_eval(self.to_str(expr_stmt.children[2]))
|
288 | 289 | inh.extend(val.items())
|
289 |
| - else: |
| 290 | + else: # noqa: PLR5501 |
290 | 291 | # handle Many2one with delegate=True attribute
|
291 | 292 | if (
|
292 | 293 | len(expr_stmt.children) == 3
|
@@ -342,7 +343,9 @@ def init_repos(path: Path) -> None:
|
342 | 343 | def checkout(wd: Path, repo: Repo, version: Version) -> bool:
|
343 | 344 | gitdir = str(wd / repo.name)
|
344 | 345 |
|
345 |
| - hasref = subprocess.run(["git", "show-ref", "-q", "--verify", f"refs/remotes/origin/{version.name}"], cwd=gitdir) |
| 346 | + hasref = subprocess.run( |
| 347 | + ["git", "show-ref", "-q", "--verify", f"refs/remotes/origin/{version.name}"], cwd=gitdir, check=False |
| 348 | + ) |
346 | 349 | if hasref.returncode != 0:
|
347 | 350 | return False # unknow branch
|
348 | 351 | subprocess.run(
|
@@ -448,7 +451,7 @@ def main(options: Namespace):
|
448 | 451 | with open(pyproject, "rb") as fp:
|
449 | 452 | line_length = tomli.load(fp)["tool"]["black"]["line-length"]
|
450 | 453 | mode = black.FileMode(target_versions={black.TargetVersion.PY27}, line_length=line_length)
|
451 |
| - print(black.format_str(output, mode=mode), end="") |
| 454 | + print(black.format_str(output, mode=mode), end="") # noqa: T201 |
452 | 455 |
|
453 | 456 |
|
454 | 457 | # def debug(options: Namespace):
|
|
0 commit comments