Skip to content

Commit a266c14

Browse files
committed
build: add ruff linter
1 parent 5f91395 commit a266c14

File tree

6 files changed

+63
-71
lines changed

6 files changed

+63
-71
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,6 @@ venv.bak/
110110

111111
# macOSX
112112
.DS_Store
113+
114+
# ruff
115+
.ruff_cache

poetry.lock

Lines changed: 28 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,6 @@ version_files = [
77
".pre-commit-config.yaml:rev:.+Commitizen"
88
]
99

10-
[tool.black]
11-
line-length = 88
12-
include = '\.pyi?$'
13-
exclude = '''
14-
/(
15-
\.git
16-
| \.hg
17-
| \.mypy_cache
18-
| \.tox
19-
| \.venv
20-
| _build
21-
| buck-out
22-
| build
23-
| dist
24-
# The following are specific to Black, you probably don't want those.
25-
| blib2to3
26-
| tests/data
27-
| profiling
28-
)/
29-
'''
30-
3110
[tool.poetry]
3211
name = "commitizen"
3312
version = "2.42.1"
@@ -80,9 +59,8 @@ pytest-regressions = "^2.4.0"
8059
pytest-freezer = "^0.4.6"
8160
# code formatter
8261
black = "^22.10"
83-
isort = "^5.10.0"
8462
# linter
85-
flake8 = "^3.6"
63+
ruff = "^0.0.262"
8664
pre-commit = "^2.6.0"
8765
mypy = "^0.931"
8866
types-PyYAML = "^5.4.3"
@@ -111,10 +89,6 @@ pep621 = "commitizen.providers:Pep621Provider"
11189
poetry = "commitizen.providers:PoetryProvider"
11290
scm = "commitizen.providers:ScmProvider"
11391

114-
[tool.isort]
115-
profile = "black"
116-
known_first_party = ["commitizen", "tests"]
117-
11892
[tool.coverage]
11993
[tool.coverage.report]
12094
show_missing = true
@@ -137,6 +111,7 @@ known_first_party = ["commitizen", "tests"]
137111
omit = [
138112
'env/*',
139113
'venv/*',
114+
'.venv/*',
140115
'*/virtualenv/*',
141116
'*/virtualenvs/*',
142117
'*/tests/*'
@@ -145,3 +120,30 @@ known_first_party = ["commitizen", "tests"]
145120
[build-system]
146121
requires = ["poetry_core>=1.0.0"]
147122
build-backend = "poetry.core.masonry.api"
123+
124+
[tool.pytest.ini_options]
125+
addopts = "--strict-markers"
126+
127+
[tool.ruff]
128+
line-length = 88
129+
ignore = [
130+
"E501",
131+
"D1",
132+
"D415",
133+
]
134+
135+
[tool.ruff.isort]
136+
known-first-party = ["commitizen", "tests"]
137+
138+
[tool.ruff.pydocstyle]
139+
convention = "google"
140+
141+
[tool.mypy]
142+
files = "commitizen"
143+
ignore_missing_imports = true
144+
disallow_untyped_decorators = true
145+
disallow_subclassing_any = true
146+
warn_return_any = true
147+
warn_redundant_casts = true
148+
warn_unused_ignores = true
149+
warn_unused_configs = true

scripts/format

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ export PREFIX="poetry run python -m "
55

66
set -x
77

8-
${PREFIX}isort commitizen tests
8+
# ${PREFIX}isort commitizen tests
9+
${PREFIX}ruff commitizen tests --fix
910
${PREFIX}black commitizen tests

scripts/test

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ export REGEX='^(?![.]|venv).*'
66

77
${PREFIX}pytest -n 3 --dist=loadfile --cov-report term-missing --cov-report=xml:coverage.xml --cov=commitizen tests/
88
${PREFIX}black commitizen tests --check
9-
${PREFIX}isort --check-only commitizen tests
10-
${PREFIX}flake8 commitizen/ tests/
9+
${PREFIX}ruff commitizen/ tests/
1110
${PREFIX}mypy commitizen/ tests/
12-
${PREFIX}pydocstyle --convention=google --add-ignore=D1,D415 --match-dir='"${REGEX}"'
1311
${PREFIX}commitizen -nr 3 check --rev-range origin/master..

setup.cfg

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)