Skip to content

Commit b0176a1

Browse files
Update ruff config (#96)
1 parent e2e08e3 commit b0176a1

2 files changed

Lines changed: 51 additions & 20 deletions

File tree

.pre-commit-config.yaml

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,16 @@ repos:
1616
- id: check-toml
1717
- id: check-added-large-files
1818

19-
- repo: https://github.com/psf/black
20-
rev: 3702ba224ecffbcec30af640c149f231d90aebdb # frozen: 24.4.2
21-
hooks:
22-
- id: black
23-
24-
- repo: https://github.com/adamchainz/blacken-docs
25-
rev: 4c97c4a0d921007af6fefae92d8447cfbf63720b # frozen: 1.18.0
26-
hooks:
27-
- id: blacken-docs
28-
29-
- repo: https://github.com/charliermarsh/ruff-pre-commit
30-
# Ruff version.
31-
rev: "1dc9eb131c2ea4816c708e4d85820d2cc8542683" # frozen: v0.5.0
32-
hooks:
33-
- id: ruff
34-
3519
- repo: https://github.com/pre-commit/mirrors-prettier
3620
rev: ffb6a759a979008c0e6dff86e39f4745a2d9eac4 # frozen: v3.1.0
3721
hooks:
3822
- id: prettier
3923
files: \.(html|md|yml|yaml|toml)
4024
args: [--prose-wrap=preserve]
25+
26+
- repo: https://github.com/astral-sh/ruff-pre-commit
27+
rev: 1dc9eb131c2ea4816c708e4d85820d2cc8542683 # frozen: v0.5.0
28+
hooks:
29+
- id: ruff
30+
args: ["--fix", "--show-fixes", "--exit-non-zero-on-fix"]
31+
- id: ruff-format

pyproject.toml

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,47 @@ Source = "https://github.com/scientific-python/yaml2ics"
4242
[tool.changelist]
4343
ignored_user_logins = ["dependabot[bot]", "pre-commit-ci[bot]", "web-flow"]
4444

45-
[tool.ruff]
46-
line-length = 88
47-
target-version = "py38"
48-
select = ["F", "E", "W", "I", "UP"]
45+
[tool.ruff.lint]
46+
extend-select = [
47+
"B", # flake8-bugbear
48+
"I", # isort
49+
"ARG", # flake8-unused-arguments
50+
"C4", # flake8-comprehensions
51+
"EM", # flake8-errmsg
52+
"ICN", # flake8-import-conventions
53+
"G", # flake8-logging-format
54+
"PGH", # pygrep-hooks
55+
"PIE", # flake8-pie
56+
"PL", # pylint
57+
"PT", # flake8-pytest-style
58+
# "PTH", # flake8-use-pathlib
59+
"RET", # flake8-return
60+
"RUF", # Ruff-specific
61+
"SIM", # flake8-simplify
62+
"T20", # flake8-print
63+
"UP", # pyupgrade
64+
"YTT", # flake8-2020
65+
"EXE", # flake8-executable
66+
"NPY", # NumPy specific rules
67+
"PD", # pandas-vet
68+
"FURB", # refurb
69+
"PYI", # flake8-pyi
70+
]
71+
ignore = [
72+
"PLR09", # Too many <...>
73+
"PLR2004", # Magic value used in comparison
74+
"ISC001", # Conflicts with formatter
75+
"ARG002", # Unused method argument
76+
"EM101", # Exception must not use a string literal
77+
"SIM115", # Use context handler for opening files
78+
"RET504", # Unnecessary assignment before `return` statement
79+
"T201", # `print` found
80+
"EM102", # Exception must not use an f-string literal
81+
"RUF015", # Prefer `next(...)` over single element slice
82+
"RUF013", # PEP 484 prohibits implicit `Optional`
83+
"RET505", # Unnecessary `elif` after `return` statement
84+
"RET503", # Missing explicit `return`
85+
"ARG001", # Unused function argument
86+
"PT012", # `pytest.raises()` block
87+
"PLW0129", # Asserting on a non-empty string literal will always pass
88+
]

0 commit comments

Comments
 (0)