Skip to content

Commit

Permalink
Update pre-commit hooks (#221)
Browse files Browse the repository at this point in the history
* Add new pre-commit hooks (black, codespell, among others)

* Remove yapf config and update isort
  • Loading branch information
Toni-SM authored Nov 4, 2024
1 parent eff7295 commit 88ac11f
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 30 deletions.
45 changes: 34 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,38 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-ast
- id: check-case-conflict
- id: check-docstring-first
- id: check-merge-conflict
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
rev: v4.6.0
hooks:
- id: check-ast
- id: check-case-conflict
- id: check-docstring-first
- id: check-json
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: detect-private-key
- id: end-of-file-fixer
- id: name-tests-test
args: ["--pytest-test-first"]
- id: no-commit-to-branch
- id: trailing-whitespace
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
additional_dependencies:
- tomli
- repo: https://github.com/python/black
rev: 24.8.0
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: isort
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal
24 changes: 5 additions & 19 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,34 +58,20 @@ tests = [
"Source" = "https://github.com/Toni-SM/skrl"


[tool.yapf]
# run: yapf -p -m -i -r <folder>
based_on_style = "pep8"
blank_line_before_nested_class_or_def = false
blank_lines_between_top_level_imports_and_variables = 2
column_limit = 120
join_multiple_lines = false
space_between_ending_comma_and_closing_bracket = false
spaces_around_power_operator = true
split_all_top_level_comma_separated_values = true
split_before_arithmetic_operator = true
split_before_dict_set_generator = false
split_before_dot = true
split_complex_comprehension = true
coalesce_brackets = true
[tool.black]
line-length = 120


[tool.codespell]
# run: codespell <folder>
skip = "./docs/_build,./docs/source/_static"
skip = "./docs/source/_static,./docs/_build,pyproject.toml"
quiet-level = 3
count = ""
count = true


[tool.isort]
use_parentheses = false
profile = "black"
line_length = 120
multi_line_output = 3
lines_after_imports = 2
known_test = [
"warnings",
Expand Down

0 comments on commit 88ac11f

Please sign in to comment.