Skip to content

Commit

Permalink
chore(pyproject.toml): Define ruff rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Artem Vasenin committed Dec 18, 2023
1 parent e993ad5 commit b4385e6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cfg/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
"""Python Configuration System"""
from __future__ import annotations

from .errors import *
from .helpers import get_output_dir
from .interfaces import *
from .leaf import *
from .node import *
from .leaf import CL
from .node import CN

__version__ = "3.1.2"
25 changes: 25 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,28 @@ version_variable = "ntc/__init__.py:__version__"
minversion = "6.0"
addopts = "--doctest-modules"

[tool.ruff]
target-version = "py312"
line-length = 120
[tool.ruff.lint]
preview = true
select = [
"A", "B", "E", "F", "I", "N", "R", "S", "Q", "W",
"ARG", "BLE", "C4", "COM", "ERA", "FBT", "FIX", "FLY", "FURB", "IC", "INP", "ISC",
"LOG", "NPY", "PERF", "PIE", "PT", "PTH", "RET", "RSE", "SIM", "SLF", "T20", "TCH",
"TD", "TID", "TRY", "UP"
]
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
ignore = ["UP035", "RET503", "S113", "TD002", "TD003", "N817", "FIX002", "TRY003",
"UP007", "A003", "PTH123", "E203",
]
[tool.ruff.per-file-ignores]
"tests/**/*.py" = [
"S101", # Asserts in tests are fine
"T201", # Prints are useful for debugging
"E501", # Test strings can be long
]
"**/__init__.py" = [
"F401", # Allow unused imports in module files
]

0 comments on commit b4385e6

Please sign in to comment.