Skip to content

Commit

Permalink
Merge pull request #44 from Dunedan/use-ruff
Browse files Browse the repository at this point in the history
Use ruff for linting and formatting
  • Loading branch information
Dunedan authored Jun 4, 2024
2 parents 8a59fe7 + 3043333 commit 64d6cf2
Show file tree
Hide file tree
Showing 17 changed files with 1,566 additions and 908 deletions.
37 changes: 12 additions & 25 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,12 @@ repos:
- id: debug-statements
- id: forbid-new-submodules

- repo: https://github.com/PyCQA/prospector
rev: v1.10.3
hooks:
- id: prospector

- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
args:
- --check-only
- --diff

- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: forbid-crlf
- id: forbid-tabs

- repo: https://github.com/PyCQA/bandit
rev: 1.7.8
hooks:
- id: bandit
args:
- --skip
- B106
- --recursive
- --exclude
- ./.tox,./.eggs
- .

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.39.0
hooks:
Expand All @@ -65,3 +40,15 @@ repos:
hooks:
- id: codespell
exclude: ^ejabberd_example.yml$

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.5
hooks:
- id: ruff
args:
- --output-format=full
- id: ruff-format
args:
- --check
- --target-version
- py311
38 changes: 0 additions & 38 deletions .prospector.yaml

This file was deleted.

49 changes: 46 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,49 @@ echelon-db = "xpartamupp.lobby_ranking:main"
modbot = "xpartamupp.modbot:main"
xpartamupp = "xpartamupp.xpartamupp:main"

[tool.isort]
line_length = 99
lines_between_types = 1
[tool.ruff]
line-length = 99

[tool.ruff.format]
line-ending = "lf"

[tool.ruff.lint]
select = ["ALL"]
ignore = [
"ANN002",
"ANN003",
"ANN101",
"ANN102",
"COM812",
"D104",
"EM",
"FBT",
"ISC001",
"PERF401",
"PLR2004",
"PT",
"PTH",
"SIM105",
"TRY003",
"UP038"
]

[tool.ruff.lint.flake8-annotations]
ignore-fully-untyped = true
suppress-dummy-args = true

[tool.ruff.lint.isort]
lines-after-imports = 2

[tool.ruff.lint.per-file-ignores]
"tests/**.py" = ["S106"]

[tool.ruff.lint.pycodestyle]
max-doc-length = 72

[tool.ruff.lint.pydocstyle]
convention = "pep257"

[tool.ruff.lint.pylint]
max-args = 8
max-nested-blocks = 4
Loading

0 comments on commit 64d6cf2

Please sign in to comment.