Skip to content

Commit 9182824

Browse files
committed
Update ruff config
1 parent 0c6b4cb commit 9182824

File tree

3 files changed

+30
-7
lines changed

3 files changed

+30
-7
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ indent_size = 3
1919
[*.nix]
2020
indent_size = 2
2121

22-
[*.py]
22+
[*.{py,ipynb}]
2323
indent_size = 4
2424
max_line_length = 120

.justfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,10 @@ check:
5353
# Remove build artifacts and non-essential files
5454
clean:
5555
@echo "Cleaning..."
56-
@find . -type d -name ".venv" -exec rm -r {} +
57-
@find . -type d -name "__pycache__" -exec rm -r {} +
58-
@find . -type d -name "*.egg-info" -exec rm -r {} +
56+
@find . -type d -name ".venv" -exec rm -rf {} +
57+
@find . -type d -name "__pycache__" -exec rm -rf {} +
58+
@find . -type d -name "*.ruff_cache" -exec rm -rf {} +
59+
@find . -type d -name "*.egg-info" -exec rm -rf {} +
5960

6061
# Format the project
6162
format:

pyproject.toml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ dev = [
3636
allow-direct-references = true
3737

3838
[tool.hatch.build.targets.wheel]
39-
packages = ["shared/utils", "src/core"]
39+
packages = ["shared", "src"]
4040

4141
[tool.mypy]
4242
exclude = "^.tmp/"
@@ -59,12 +59,34 @@ extend-exclude = [
5959
"notebooks",
6060
".cache",
6161
]
62-
line-length = 100
62+
line-length = 120
6363

6464
[tool.ruff.lint]
65-
ignore = ["E501"]
65+
ignore = [
66+
"E402", # Module level import not at top of file
67+
"E501", # Line too long
68+
"E203", # Whitespace before ':' -> conflicts with black
69+
"D401", # First line should be in imperative mood
70+
"RET504", # Unnecessary variable assignment before return statement
71+
"RET505", # Unnecessary elif after return statement
72+
"SIM102", # Use a single if-statement instead of nested if-statements
73+
"SIM117", # Merge with statements for context managers that have same scope
74+
"SIM118", # Checks for key-existence checks against dict.keys() calls
75+
]
6676
select = ["E", "F", "I"]
6777

78+
[tool.ruff.lint.per-file-ignores]
79+
"*/__init__.py" = ["F401"] # Unused import
80+
81+
[tool.ruff.lint.isort]
82+
known-first-party = ["modern_python", "core"]
83+
84+
[tool.ruff.lint.pydocstyle]
85+
convention = "google"
86+
87+
[tool.ruff.lint.mccabe]
88+
max-complexity = 30
89+
6890
[tool.pytest.ini_options]
6991
cache_dir = ".pytest_cache"
7092
pythonpath = [".", "scripts", "src"]

0 commit comments

Comments
 (0)