Skip to content

Commit

Permalink
global: add pre-commit with ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
PascalEgn committed Aug 6, 2024
1 parent 81cfdd5 commit 3efd5a1
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 1 deletion.
17 changes: 17 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
repos:
- repo: https:/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: name-tests-test
args: [ --pytest-test-first ]
exclude: '^(?!factories/)'
- repo: https:/astral-sh/ruff-pre-commit
rev: v0.5.6
hooks:
- id: ruff
args: [ --fix ]
30 changes: 30 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
target-version = "py311"
line-length = 100
[lint.flake8-tidy-imports]
ban-relative-imports = "all"

[lint]
select = [
# pycodestyle
"E",
# Pyflakes
"F",
# flake8-bugbear
"B",
# flake8-simplify
"SIM",
# isort
"I",
# flake8-tidy-imports
"TID",
# flake8-pytest-style
"PT",
]
ignore = ["B904"]


[lint.pycodestyle]
ignore-overlong-task-comments = true

[lint.pydocstyle]
convention = "google"
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,18 @@
"pytest-cov~=2.0,>=2.6.1",
]

dev_require = [
"pre-commit==3.5.0",
]

extras_require = {
"docs": docs_require,
"tests": tests_require,
"dev": dev_require,
}

extras_require["all"] = []
for name, reqs in extras_require.items():
for _name, reqs in extras_require.items():
extras_require["all"].extend(reqs)

packages = find_packages(exclude=["docs"])
Expand Down

0 comments on commit 3efd5a1

Please sign in to comment.