Skip to content

Commit f6f892e

Browse files
committed
meta: lint-generated-project
1 parent b4073ef commit f6f892e

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

.ruff.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ max-complexity = 10
9898
]
9999
"exceptions.py" = ["D107"]
100100
"noxfile.py" = ["S101"]
101+
"scripts/*" = ["S603"]
101102

102103
[lint.pydocstyle]
103104
convention = "google"

noxfile.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ def format_python(session: Session) -> None:
8282
session.install("-e", ".", "--group", "dev")
8383

8484
session.log(f"Running Ruff formatter check with py{session.python}.")
85-
# Use --check, not fix. Fixing is done by pre-commit or manual run.
8685
session.run("ruff", "format", *session.posargs)
8786

8887

@@ -93,7 +92,7 @@ def lint_python(session: Session) -> None:
9392
session.install("-e", ".", "--group", "dev")
9493

9594
session.log(f"Running Ruff check with py{session.python}.")
96-
session.run("ruff", "check", "--verbose")
95+
session.run("ruff", "check", "--fix", "--verbose")
9796

9897

9998
@nox.session(python=PYTHON_VERSIONS, name="typecheck", tags=[TYPE, PYTHON, CI])

scripts/util.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
"""Module containing util"""
1+
"""Module containing util."""
22
import argparse
3-
import os
43
import stat
54
import subprocess
65
from pathlib import Path
@@ -11,6 +10,7 @@
1110
class MissingDependencyError(Exception):
1211
"""Exception raised when a depedency is missing from the system running setup-repo."""
1312
def __init__(self, project: Path, dependency: str):
13+
"""Initializes MisssingDependencyError."""
1414
super().__init__("\n".join([
1515
f"Unable to find {dependency=}.",
1616
f"Please ensure that {dependency} is installed before setting up the repo at {project.absolute()}"
@@ -22,8 +22,8 @@ def check_dependencies(path: Path, dependencies: list[str]) -> None:
2222
for dependency in dependencies:
2323
try:
2424
subprocess.check_call([dependency, "--version"], cwd=path)
25-
except subprocess.CalledProcessError:
26-
raise MissingDependencyError(path, dependency)
25+
except subprocess.CalledProcessError as e:
26+
raise MissingDependencyError(path, dependency) from e
2727

2828

2929
def existing_dir(value: str) -> Path:
@@ -43,5 +43,5 @@ def remove_readonly(func: Callable[[str], Any], path: str, _: Any) -> None:
4343
4444
This is passed to shutil.rmtree as the onerror kwarg.
4545
"""
46-
os.chmod(path, stat.S_IWRITE)
46+
Path(path).chmod(stat.S_IWRITE)
4747
func(path)

0 commit comments

Comments
 (0)