Skip to content

Commit

Permalink
Replace black with ruff-format
Browse files Browse the repository at this point in the history
  • Loading branch information
kenodegard committed Nov 1, 2023
1 parent e2916a2 commit 60f7984
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
17 changes: 4 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,28 +48,19 @@ repos:
files: \.py$
args: [--license-filepath, .github/disclaimer.txt, --no-extra-eol]
exclude: ^conda_build/version.py
- repo: https://github.com/asottile/pyupgrade
rev: v3.13.0
hooks:
# upgrade standard Python codes
- id: pyupgrade
args: [--py38-plus]
- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
# auto format Python codes
- id: black
- repo: https://github.com/asottile/blacken-docs
rev: 1.16.0
hooks:
# auto format Python codes within docstrings
- id: blacken-docs
additional_dependencies: [black]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.291
rev: v0.1.3
hooks:
# lint & attempt to correct failures (e.g. pyupgrade)
- id: ruff
args: [--fix]
# compatible replacement for black
- id: ruff-format
- repo: meta
# see https://pre-commit.com/#meta-hooks
hooks:
Expand Down
7 changes: 2 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ include = ["conda_build", "conda_build/templates/*", "conda_build/cli-*.exe"]
[tool.hatch.build.hooks.vcs]
version-file = "conda_build/__version__.py"

[tool.black]
target-version = ['py38', 'py39', 'py310', 'py311']

[tool.coverage.run]
# store relative paths in coverage information
relative_files = true
Expand All @@ -95,7 +92,7 @@ skip_covered = true
omit = ["conda_build/skeletons/_example_skeleton.py"]

[tool.ruff]
line-length = 180
pycodestyle = {max-line-length = 120}
# E, W = pycodestyle errors and warnings
# F = pyflakes
# I = isort
Expand All @@ -104,7 +101,7 @@ select = ["E", "W", "F", "I"]
# E722 do not use bare 'except'
# E731 do not assign a lambda expression, use a def
ignore = ["E402", "E722", "E731"]
# Use PEP 257-style docstrings.
target-version = "py38"
pydocstyle = {convention = "pep257"}

[tool.pytest.ini_options]
Expand Down

0 comments on commit 60f7984

Please sign in to comment.