Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add daily scheduled run and minor tweaks #17

Merged
merged 3 commits into from
Feb 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -5,6 +5,8 @@ on:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: '0 5 * * *'

permissions:
contents: read
6 changes: 3 additions & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -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")
67 changes: 34 additions & 33 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Loading