Initial commit

This commit is contained in:
Hal 2025-01-06 01:26:03 +08:00 committed by GitHub
commit b1a1a6866d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 495 additions and 0 deletions

17
nox_actions/lint.py Normal file
View file

@ -0,0 +1,17 @@
# Import third-party modules
import nox
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")
session.run("autoflake", "--in-place", "--remove-all-unused-imports", "--remove-unused-variables")