Skip to content

Commit

Permalink
chore(dev): switch formatting to ruff format
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Nov 18, 2023
1 parent 6c85377 commit 366b92f
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 42 deletions.
3 changes: 1 addition & 2 deletions .dir-locals.el
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
;;; For more information see (info "(emacs) Directory Variables")

((python-mode
(eval python-isort-on-save-mode)
(eval blacken-mode)))
(mode . ruff-format-on-save)))
5 changes: 0 additions & 5 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@
"commitMessageTopic": "{{depName}}",
"semanticCommitScope": "pre-commit"
},
{
"matchPackagePatterns": ["(^|/)black(-pre-commit-mirror)?$"],
"groupName": "black",
"versioning": "pep440"
},
{
"matchPackagePatterns": ["(^|/)gitlint$"],
"groupName": "gitlint",
Expand Down
6 changes: 1 addition & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ repos:
rev: v0.1.6
hooks:
- id: ruff

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.1.0
hooks:
- id: black
- id: ruff-format

- repo: local
hooks:
Expand Down
2 changes: 1 addition & 1 deletion .pymarkdown.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"plugins": {
"line-length": {
"//": "For long output in README.md (+ coincides with black)",
"//": "For long output in README.md (+ coincides with black/ruff)",
"code_block_line_length": 88
}
}
Expand Down
46 changes: 18 additions & 28 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,38 +1,28 @@
[tool.black]
target-version = [
"py35",
"py36",
"py37",
"py38",
"py39",
"py310",
"py311",
# TODO: "py312" when supported

]

[tool.ruff]
select = [
"ALL",
# E and W rules not covered by Black
"E71",
"E72",
"E73",
"E74",
"E9",
"W605",
]
select = ["ALL"]
ignore = [
"ANN", # Maybe sometime
"COM", # Black
"D203", # Black, ping/pong with D211
"D203", # Ping/pong with D211
"D213", # Ping/pong with D212
"E", # Black, except ones in `select` above
"FA", # See what happens with PEP 649 impl first
"UP014", # Python >= 3.6
"UP032", # Python >= 3.6
"W", # Black, except ones in `select` above

# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
# (keep order of ignores here same as ^there for maintainability)
"W191",
"E111",
"E114",
"E117",
"D206",
"D300",
"Q000",
"Q001",
"Q002",
"Q003",
"COM812",
"COM819",
"ISC001",
"ISC002",
]
unfixable = [
"T20",
Expand Down
1 change: 0 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
-e .[completion]
-r requirements-test.txt

black==23.1.0
mypy==1.0.1
nox
ruff==0.1.6

0 comments on commit 366b92f

Please sign in to comment.