Skip to content

Commit

Permalink
chore: update ruff config
Browse files Browse the repository at this point in the history
  • Loading branch information
wcxve committed Jan 31, 2024
1 parent 6bf0f47 commit 4f94866
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 20 deletions.
6 changes: 5 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ repos:
- id: end-of-file-fixer
exclude_types: [json, binary]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.1.9"
rev: "v0.1.15"
hooks:
- id: ruff-format
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.1.15"
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
29 changes: 10 additions & 19 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ docs = [
"sphinx_rtd_theme",
"numpydoc"
]
dev = ["pre-commit>=3.6.0", "black", "ruff"]
dev = ["pre-commit>=3.6.0", "ruff"]


[project.urls]
Expand All @@ -67,30 +67,21 @@ build.targets.wheel.packages = ["src/elisa"]
[[tool.hatch.envs.all.matrix]]
python = ["3.9", "3.10", "3.11"]


[tool.black]
target-version = ["py39"]
line-length = 79
skip-string-normalization = true


[tool.ruff]
format.quote-style = "single"
target-version = "py39"
line-length = 79
select = ["F", "I", "E", "W", "YTT", "B", "Q", "PLE", "PLR", "PLW", "UP"]
ignore = [
"E741", # Allow ambiguous variable names
"PLR0911", # Allow many return statements
"PLR0913", # Allow many arguments to functions
"PLR0915", # Allow many statements
"PLR2004", # Allow magic numbers in comparisons
]
unfixable = [
"F401", # Don't touch unused imports
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"C", # flake8-comprehensions
"B", # flake8-bugbear
"UP", # pyupgrade
]
extend-select = ["Q"]
extend-include = ["*.ipynb"]
exclude = []
isort.known-first-party = ["elisa"]
isort.combine-as-imports = true

Expand Down

0 comments on commit 4f94866

Please sign in to comment.