Skip to content
Open
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
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions src/fren.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down