Skip to content

Commit

Permalink
OPT: Use ruff latest and mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
woile committed Apr 25, 2024
1 parent 820667e commit d89f25e
Show file tree
Hide file tree
Showing 6 changed files with 298 additions and 332 deletions.
603 changes: 279 additions & 324 deletions poetry.lock

Large diffs are not rendered by default.

14 changes: 12 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ commitizen = "^3.8.0"

[tool.poetry.group.dev.dependencies]
pytest = "^7.2.2"
black = "^23.3.0"
ruff = "^0.0.262"
ruff = "^0.4.0"
mypy = "^1.10.0"

[build-system]
requires = ["poetry-core"]
Expand All @@ -32,3 +32,13 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry.plugins."commitizen.plugin"]
cz_kpn = "cz_kpn:KPNCz"

[tool.ruff.lint.isort]
known-first-party = ["cz_kpn", "tests"]

[tool.ruff.lint]
select = ["I"]

[tool.mypy]
mypy_path = "src"
ignore_missing_imports = true
4 changes: 2 additions & 2 deletions scripts/format
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ fi

set -x

${PREFIX}black cz_kpn tests
${PREFIX}ruff cz_kpn tests --fix
${PREFIX}ruff format src tests
${PREFIX}ruff check src tests --fix


6 changes: 3 additions & 3 deletions scripts/lint
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ if [ -d '.venv' ] ; then
export PREFIX=".venv/bin/"
fi

${PREFIX}black cz_kpn tests --check --diff
${PREFIX}ruff cz_kpn/ tests/
${PREFIX}mypy cz_kpn/ tests
${PREFIX}ruff check src/ tests/
${PREFIX}ruff format --check src/ tests/
${PREFIX}mypy src/ tests
2 changes: 1 addition & 1 deletion src/cz_kpn/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
)

BUMP_PATTERN = r"^(NEW|CHANGE|FIX|OPT|BREAK)"
COMMIT_PARSER = r"^(?P<change_type>NEW|CHANGE|FIX|OPT|BREAK)(?:\((?P<scope>[^()\r\n]*)\)|\()?:?\s(?P<message>.+)" # noqa
COMMIT_PARSER = r"^(?P<change_type>NEW|CHANGE|FIX|OPT|BREAK)(?:\((?P<scope>[^()\r\n]*)\)|\()?:?\s(?P<message>.+)" # noqa
1 change: 1 addition & 0 deletions tests/test_commit_parser.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import re

import pytest

try:
Expand Down

0 comments on commit d89f25e

Please sign in to comment.