Skip to content

Commit

Permalink
Merge pull request #69 from acsone/pre-commit-autoupdate
Browse files Browse the repository at this point in the history
Upgrade linters
  • Loading branch information
sbidoul authored May 2, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 2d31bef + 6f33109 commit 844ba8b
Showing 4 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -2,14 +2,14 @@ default_language_version:
python: python3
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.8
rev: v0.4.2
hooks:
- id: ruff
args: [--exit-non-zero-on-fix]
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -60,7 +60,10 @@ exclude = [
]

[tool.ruff]
target-version = "py37"
fix = true

[tool.ruff.lint]
extend-select = [
"B", # flake8-bugbear
"C4", # flake8-comprehensions
@@ -78,7 +81,6 @@ extend-select = [
"TRY",
"W",
]
target-version = "py37"
ignore = [
# "C408", # Unnecessary `dict` call (rewrite as a literal)
]
@@ -87,15 +89,15 @@ exclude = [
"mk_core_addons",
]

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"tests/*.py" = [
"S101", # use of assert detected
"S603", # `subprocess` call: check for execution of untrusted input
"S607", # Starting a process with a partial executable path
]


[tool.ruff.isort]
[tool.ruff.lint.isort]
known-first-party = ["manifestoo_core"]


6 changes: 3 additions & 3 deletions src/manifestoo_core/git_postversion.py
Original file line number Diff line number Diff line change
@@ -175,11 +175,11 @@ def get_git_postversion( # noqa: C901, PLR0911, PLR0912 too complex
return last_version
if last_sha:
if strategy == POST_VERSION_STRATEGY_NINETYNINE_DEVN:
return last_version + ".99.dev%s" % count
return last_version + f".99.dev{count}"
if strategy == POST_VERSION_STRATEGY_P1_DEVN:
return _bump_last(last_version) + ".dev%s" % count
return _bump_last(last_version) + f".dev{count}"
if strategy == POST_VERSION_STRATEGY_DOT_N:
return last_version + ".%s" % count
return last_version + f".{count}"
msg = f"Unknown postversion strategy: {strategy}"
raise UnknownPostVersionStrategy(msg)
if uncommitted:
1 change: 1 addition & 0 deletions src/manifestoo_core/odoo_series.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Odoo Series and Editions."""

from enum import Enum
from typing import Optional, Set

0 comments on commit 844ba8b

Please sign in to comment.