Skip to content

Commit

Permalink
ENH: Refactor code linter and formatter dependencies
Browse files Browse the repository at this point in the history
Refactor code linter and formatter dependencies:
- Remove `black`, `flake8` and `isort` dependencies from
  `pyproject.toml`: the role has been taken over by `ruff` in commit
  81b3690.
- Transfer the `black` and `isort` rules left behind to `ruff` in
  `pyproject.toml`
- Remove `black`, `flake8` and `isort` from the pre-commit config file
  and use `ruff` instead.
  • Loading branch information
jhlegarreta committed Mar 27, 2024
1 parent d23dcf0 commit cea32f0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 39 deletions.
16 changes: 5 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,9 @@ repos:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: debug-statements
- repo: https://github.com/timothycrosley/isort
rev: 5.10.1
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.4
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 4.0.1
hooks:
- id: flake8
- id: ruff
args: [ --fix ]
- id: ruff-format
43 changes: 15 additions & 28 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ doc = [
]

dev = [
"black",
"flake8",
"flake8-pyproject",
"isort",
"ruff",
"pre-commit",
"pre-commit-hooks",
]
Expand Down Expand Up @@ -112,32 +109,21 @@ version-file = "src/eddymotion/_version.py"
# Developer tool configurations
#

[tool.black]
line-length = 99
target-version = ['py39']
skip-string-normalization = true
exclude = '''
# Directories
/(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| venv
| _build
| build
| dist
)/
'''

[tool.isort]
profile = 'black'
skip_gitignore = true

[tool.ruff]
line-length = 99
target-version = "py39"
exclude = [
".eggs",
".git",
".hg",
".mypy_cache",
".tox",
".venv",
"venv",
"_build",
"build",
"dist",
]

[tool.ruff.lint]
select = [
Expand All @@ -146,6 +132,7 @@ select = [
"C",
"W",
"B",
"I",
]
ignore = [
"E203"
Expand Down

0 comments on commit cea32f0

Please sign in to comment.