From 42c14d27faae1ae19e81474b1ac2b5f9d398457b Mon Sep 17 00:00:00 2001 From: yanovs <42386943+yanovs@users.noreply.github.com> Date: Sat, 24 Feb 2024 07:16:03 -0500 Subject: [PATCH 1/3] Update for new ruff config structure --- pyproject.toml | 67 +++++++++++++++++++++++++------------------------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e736b70..a8ea2b7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,6 +42,37 @@ reportPrivateImportUsage = "none" target-version = "py38" line-length = 79 +# Exclude a variety of commonly ignored directories. +exclude = [ + ".bzr", + ".direnv", + ".eggs", + ".git", + ".hg", + ".mypy_cache", + ".nox", + ".pants.d", + ".pytest_cache", + ".pytype", + ".ruff_cache", + ".svn", + ".tox", + ".venv", + "__pypackages__", + "_build", + "buck-out", + "build", + "dist", + "node_modules", + "venv", +] + +[tool.ruff.format] +# https://docs.astral.sh/ruff/formatter/ +quote-style = "double" +indent-style = "space" + +[tool.ruff.lint] select = [ # https://beta.ruff.rs/docs/rules/#pyflakes-f "F", @@ -72,48 +103,18 @@ ignore = [ "ANN101", "ANN102", "ANN401", ] -# Exclude a variety of commonly ignored directories. -exclude = [ - ".bzr", - ".direnv", - ".eggs", - ".git", - ".hg", - ".mypy_cache", - ".nox", - ".pants.d", - ".pytest_cache", - ".pytype", - ".ruff_cache", - ".svn", - ".tox", - ".venv", - "__pypackages__", - "_build", - "buck-out", - "build", - "dist", - "node_modules", - "venv", -] - # Allow unused variables when underscore-prefixed. dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" -[tool.ruff.format] -# https://docs.astral.sh/ruff/formatter/ -quote-style = "double" -indent-style = "space" - -[tool.ruff.mccabe] +[tool.ruff.lint.mccabe] max-complexity = 10 -[tool.ruff.isort] +[tool.ruff.lint.isort] force-sort-within-sections = true section-order = [ "future", "standard-library", "third-party", "first-party", "local-folder" ] single-line-exclusions = ["collections.abc", "typing", "typing_extensions"] -[tool.ruff.pydocstyle] +[tool.ruff.lint.pydocstyle] convention = "google" From be1499f4c213fd08c1dbe685a0a9ddfa7f0f1611 Mon Sep 17 00:00:00 2001 From: yanovs <42386943+yanovs@users.noreply.github.com> Date: Sat, 24 Feb 2024 07:16:09 -0500 Subject: [PATCH 2/3] Tweak order of checkers --- noxfile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/noxfile.py b/noxfile.py index e44a7fb..4a3132e 100644 --- a/noxfile.py +++ b/noxfile.py @@ -37,7 +37,7 @@ if any(arg.startswith("fix") for arg in sys.argv): nox.options.sessions = ["fix_ruff"] else: - nox.options.sessions = ["mypy", "pyright", "pytest", "ruff"] + nox.options.sessions = ["ruff", "mypy", "pyright", "pytest"] def is_isolated_venv(session: nox.Session) -> bool: @@ -82,16 +82,16 @@ def pytest(session: nox.Session) -> None: def ruff(session: nox.Session) -> None: if is_isolated_venv(session): session.install("-e", ".[test]") - session.run("ruff", "check", "dilib") session.run("ruff", "format", "dilib", "--check") + session.run("ruff", "check", "dilib") @nox.session(tags=["fix"]) def fix_ruff(session: nox.Session) -> None: if is_isolated_venv(session): session.install("-e", ".[test]") - session.run("ruff", "check", "dilib", "--fix") session.run("ruff", "format", "dilib") + session.run("ruff", "check", "dilib", "--fix") @nox.session(venv_backend="none") From fd1434deedd1446bf775ba5236ea8d48df79d634 Mon Sep 17 00:00:00 2001 From: yanovs <42386943+yanovs@users.noreply.github.com> Date: Sat, 24 Feb 2024 07:54:56 -0500 Subject: [PATCH 3/3] Add daily scheduled run --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7d73e0c..1b911f0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,6 +5,8 @@ on: branches: [main] pull_request: branches: [main] + schedule: + - cron: '0 5 * * *' permissions: contents: read