diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7bd6be8..b5c68e7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,16 +20,16 @@ repos: exclude: '\.golden$' - id: debug-statements - repo: https://github.com/pappasam/toml-sort - rev: v0.24.3 + rev: v0.24.4 hooks: - id: toml-sort-fix exclude: '.*\.lock$' - repo: https://github.com/google/keep-sorted - rev: v0.7.1 + rev: v0.8.0 hooks: - id: keep-sorted - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.2 + rev: v0.15.9 hooks: - id: ruff-format - id: ruff-check @@ -61,7 +61,7 @@ repos: args: - --no-error-on-unmatched-pattern - repo: https://github.com/commitizen-tools/commitizen - rev: v4.9.1 + rev: v4.13.9 hooks: - id: commitizen stages: diff --git a/src/fren.py b/src/fren.py index 3c5095c..ad6d467 100644 --- a/src/fren.py +++ b/src/fren.py @@ -327,9 +327,9 @@ def unique_file_name(path_or_str: PathOrStr) -> Path: original_stem = match.group("original_stem") index = int(match.group("index") or 0) + 1 - new_stem = original_stem if original_stem else path.stem + new_stem = original_stem or path.stem - new_name = f"{new_stem}_Copy{index if index else ''}{path.suffix}" + new_name = f"{new_stem}_Copy{index or ''}{path.suffix}" path = path.with_name(new_name) return path