Skip to content

Commit

Permalink
style: add ruff and black to pre-commit
Browse files Browse the repository at this point in the history
[pre-commit.ci skip]
  • Loading branch information
d-v-b committed Jul 12, 2023
1 parent aa5db9f commit 9c8137a
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 8 deletions.
19 changes: 11 additions & 8 deletions .pre-commit-config.yaml
Expand Up @@ -5,15 +5,18 @@ default_stages: [commit, push]
default_language_version:
python: python3
repos:
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
- repo: https://github.com/charliermarsh/ruff-pre-commit
# Ruff version.
rev: 'v0.0.224'
hooks:
- id: flake8
args: [
--max-line-length=100
]
exclude: ^(venv/|docs/)
types: ['python']
- id: ruff
# Respect `exclude` and `extend-exclude` settings.
args: ["--force-exclude"]
- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
- id: black
language_version: python3.8
- repo: https://github.com/codespell-project/codespell
rev: v2.2.5
hooks:
Expand Down
36 changes: 36 additions & 0 deletions pyproject.toml
Expand Up @@ -72,6 +72,42 @@ version_scheme = "guess-next-dev"
local_scheme = "dirty-tag"
write_to = "zarr/version.py"

[tool.ruff]
line-length = 100
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".mypy_cache",
".nox",
".pants.d",
".ruff_cache",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"venv",
"docs"
]

[tool.black]
line-length = 100
exclude = '''
/(
\.git
| \.mypy_cache
| \.venv
| _build
| buck-out
| build
| dist
| docs
)/
'''

[tool.mypy]
python_version = "3.8"
ignore_missing_imports = true
Expand Down

0 comments on commit 9c8137a

Please sign in to comment.