Skip to content

Commit

Permalink
Change flake8 → Ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
hattya committed Oct 20, 2024
1 parent 9d9f919 commit 43fb37f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 10 deletions.
24 changes: 24 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,27 @@ exclude_lines = [
[tool.mypy]
implicit_reexport = true
strict = true

[tool.ruff]
line-length = 160

[tool.ruff.lint]
select = [
"E",
"W",
"F",
"UP",
"B0",
"C4",
]
ignore = [
"E74",
]

[tool.ruff.lint.per-file-ignores]
"scmver/__init__.py" = [
"F403",
]

[tool.ruff.lint.pyupgrade]
keep-runtime-typing = true
2 changes: 1 addition & 1 deletion scmver/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def stat(path: Path, **kwargs: Any) -> Optional[SCMInfo]:
if sys.version_info >= (3, 10):
impls = tuple((ep.name, ep.load()) for ep in importlib.metadata.entry_points(group='scmver.parse'))
else:
impls = tuple(set((ep.name, ep.load()) for ep in importlib.metadata.entry_points().get('scmver.parse', [])))
impls = tuple({(ep.name, ep.load()) for ep in importlib.metadata.entry_points().get('scmver.parse', [])})
if not impls:
from . import bazaar as bzr, darcs, fossil as fsl, git, mercurial as hg, subversion as svn

Expand Down
6 changes: 0 additions & 6 deletions setup.cfg

This file was deleted.

5 changes: 2 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ deps =
coverage[toml] >= 5.0
pip >= 10.0
setuptools >= 61.0
flake8 >= 3.7
flake8-bugbear
ruff
mypy
types-setuptools
extras =
Expand All @@ -21,6 +20,6 @@ commands =
coverage run --source=scmver -m unittest discover -s tests {posargs}
coverage report
# lint
flake8
ruff check
# type
mypy scmver

0 comments on commit 43fb37f

Please sign in to comment.