2025-01-06 01:26:03 +08:00
|
|
|
# Import third-party modules
|
|
|
|
|
import nox
|
2025-05-27 11:25:25 +08:00
|
|
|
|
2025-01-06 01:26:03 +08:00
|
|
|
from nox_actions.utils import PACKAGE_NAME
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def lint(session: nox.Session) -> None:
|
|
|
|
|
session.install("isort", "ruff")
|
|
|
|
|
session.run("isort", "--check-only", PACKAGE_NAME)
|
|
|
|
|
session.run("ruff", "check")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def lint_fix(session: nox.Session) -> None:
|
|
|
|
|
session.install("isort", "ruff", "pre-commit", "autoflake")
|
|
|
|
|
session.run("ruff", "check", "--fix")
|
|
|
|
|
session.run("isort", ".")
|
|
|
|
|
session.run("pre-commit", "run", "--all-files")
|
2025-05-27 17:36:25 +08:00
|
|
|
session.run(
|
|
|
|
|
"autoflake",
|
|
|
|
|
"--in-place",
|
|
|
|
|
"--remove-all-unused-imports",
|
|
|
|
|
"--remove-unused-variables",
|
|
|
|
|
)
|