Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ jobs:

- name: Run static analysis
run: |
# hatch fmt --check
echo linter errors will be fixed in a separate PR
hatch fmt --linter --check

- name: Run tests
run: hatch test --python ${{ matrix.python-version }} --cover --randomize --parallel --retries 2 --retry-delay 1
89 changes: 89 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,92 @@ exclude_lines = [
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]

[tool.ruff]
# Set target version to 3.10 to support match statements
target-version = "py310"

[tool.ruff.lint]
# Suppress all current linter errors to establish a baseline
ignore = [
"A001", # Variable shadows built-in
"A002", # Argument shadows built-in
"A004", # Import shadows built-in
"ARG001", # Unused function argument
"B006", # Mutable default argument
"B007", # Unused loop control variable
"B008", # Function call in argument defaults
"B023", # Function uses loop variable
"B904", # raise-without-from-inside-except
"BLE001", # Blind except
"C405", # Unnecessary literal set
"C416", # Unnecessary comprehension
"E721", # Type comparison using ==
"E722", # Bare except
"E741", # Ambiguous variable name
"EM101", # Exception string literal
"EM102", # Exception f-string
"F401", # Unused import
"F541", # f-string without placeholders
"F811", # Redefinition of unused name
"F821", # Undefined name
"F841", # Unused variable
"FA100", # Missing from __future__ import annotations
"FA102", # Missing from __future__ import annotations in stub
"FBT001", # Boolean positional arg in function definition
"FBT002", # Boolean default value in function definition
"FURB188", # Prefer removeprefix over conditional slice
"G004", # Logging with f-string
"I001", # Import block unsorted or unformatted
"INP001", # Implicit namespace package
"LOG015", # root logger usage
"N801", # Class name should use CapWords convention
"N802", # Function name should be lowercase
"N806", # Variable in function should be lowercase
"N818", # Exception name should end with Error
"PERF102", # Use keys() or values() instead of items()
"PERF401", # Use list comprehension
"PIE790", # Unnecessary pass statement
"PLC0415", # Import should be at top of file
"PLC1802", # Use of len(x) == 0
"PLR2004", # Magic value used in comparison
"PLW0602", # Global variable not assigned
"PLW0603", # Using global statement
"PLW1508", # Invalid envvar default
"PLW2901", # Outer loop variable overwritten
"PT011", # pytest.raises too broad
"PYI041", # Use float instead of int | float
"RET503", # Missing explicit return
"RET504", # Unnecessary assignment before return
"RET505", # Unnecessary else after return
"RET506", # Unnecessary else after raise
"RUF005", # Unpack instead of concatenation
"RUF010", # Use explicit conversion flag
"RUF015", # Prefer next() over single element slice
"RUF059", # Use of private function/attribute
"RUF100", # Unused noqa directive
"S108", # Hardcoded temp file/directory
"S607", # Starting process with partial path
"SIM102", # Use single if statement
"SIM115", # Use context handler for file
"SIM210", # Use ternary operator
"SLF001", # Private member access
"T201", # print found
"TID252", # Relative imports from parent modules
"TRY003", # Raise vanilla args
"TRY004", # Prefer TypeError for wrong type
"TRY300", # Consider moving statement to else
"TRY301", # Abstract raise to inner function
"TRY400", # Use logging.exception instead of logging.error
"UP004", # Use X | Y for union types
"UP006", # Use X | Y for union types in isinstance
"UP009", # UTF-8 encoding declaration
"UP015", # Unnecessary mode argument
"UP020", # Use builtin open
"UP024", # Replace aliased errors with OSError
"UP032", # Use f-string
"UP035", # Import from collections.abc
"UP045", # Use X | None for type annotations
"W291", # Trailing whitespace
"W293", # Blank line contains whitespace
]