Skip to content

Commit

Permalink
Add pre-commit hooks
Browse files Browse the repository at this point in the history
Now both isort and black are included in the pre-commit hooks.

Re spine-tools/Spine-Toolbox#2897
  • Loading branch information
Henrik Koski committed Jul 22, 2024
1 parent 8da9d87 commit 58c1629
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
repos:
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/python/black
rev: 24.4.2
hooks:
- id: black
1 change: 1 addition & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ sphinx_rtd_theme
sphinx-autoapi
pylint
black == 24.4.2
pre-commit
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ ignore_errors = true

[tool.black]
line-length = 120
exclude = '\.git|version.py'
force-exclude = '\.git|version.py'

[tool.isort]
profile = "black"
lines_between_sections = 0
force_sort_within_sections = true
honor_case_in_force_sorted_sections = true
skip = ["version.py"]
skip = [".git", "version.py"]
line_length = 120
known_first_party = ["spinedb_api"]

0 comments on commit 58c1629

Please sign in to comment.