Skip to content

Commit

Permalink
Replace black by Ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
bittremieux committed Apr 21, 2024
1 parent f20aa10 commit c2a1791
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 27 deletions.
16 changes: 11 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
repos:
- repo: https://github.com/psf/black
rev: 22.8.0 # Replace by any tag/version: https://github.com/psf/black/tags
hooks:
- id: black
language_version: python3 # Should be a command that runs python3.6+
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.4.1
hooks:
# Run the linter.
- id: ruff
types_or: [ python, pyi, jupyter ]
args: [ --fix ]
# Run the formatter.
- id: ruff-format
types_or: [ python, pyi, jupyter ]
24 changes: 3 additions & 21 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,7 @@ build-backend = 'setuptools.build_meta'

[tool.setuptools_scm]

[tool.black]
[tool.ruff]
line-length = 79
target-version = ['py312']
include = '\.pyi?$'
exclude = '''
(
/(
\.eggs # exclude a few common directories in the
| \.git # root of the project
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
)/
| foo.py # also separately exclude a file named foo.py in
# the root of the project
)
'''
target-version = "py310"
include = ["*.py"]
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ install_requires =

[options.extras_require]
dev =
black
pytest
pytest-cov
ruff
docs =
myst-parser
numpydoc>=1.1.0
Expand Down

0 comments on commit c2a1791

Please sign in to comment.