Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade linters #69

Merged
merged 1 commit into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ exclude = [
]

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

[tool.ruff.lint]
extend-select = [
"B", # flake8-bugbear
"C4", # flake8-comprehensions
Expand All @@ -78,7 +81,6 @@ extend-select = [
"TRY",
"W",
]
target-version = "py37"
ignore = [
# "C408", # Unnecessary `dict` call (rewrite as a literal)
]
Expand All @@ -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"]


Expand Down
6 changes: 3 additions & 3 deletions src/manifestoo_core/git_postversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
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

Expand Down
Loading