Skip to content

Commit

Permalink
Merge pull request #2722 from mashehu/fix-files-unchanged-parital
Browse files Browse the repository at this point in the history
fix ignoring changes in partial template files
  • Loading branch information
mashehu authored Feb 7, 2024
2 parents 7899cd5 + 21c2c12 commit fca9d74
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

### General

- fix ignoring changes in partially templated files (e.g. `.gitignore`) ([#2722](https://github.com/nf-core/tools/pull/2722))
- update ruff to 0.2.0 and add it to pre-commit step ([#2725](https://github.com/nf-core/tools/pull/2725))
- Update codecov/codecov-action digest to e0b68c6 ([#2728](https://github.com/nf-core/tools/pull/2728))
- Update pre-commit hook astral-sh/ruff-pre-commit to v0.2.1 ([#2730](https://github.com/nf-core/tools/pull/2730))
Expand Down
2 changes: 1 addition & 1 deletion nf_core/lint/files_exist.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def pf(file_path: Union[str, Path]) -> Path:

# Files that cause an error if they exist
for file in files_fail_ifexists:
if file in ignore_files:
if str(file) in ignore_files:
continue
if pf(file).is_file():
failed.append(f"File must be removed: {self._wrap_quotes(file)}")
Expand Down
2 changes: 1 addition & 1 deletion nf_core/lint/files_unchanged.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def _tf(file_path: Union[str, Path]) -> Path:
# Files that can be added to, but that must contain the template contents
for files in files_partial:
# Ignore if file specified in linting config
if any([f in ignore_files for f in files]):
if any([str(f) in ignore_files for f in files]):
ignored.append(f"File ignored due to lint config: {self._wrap_quotes(files)}")

# Ignore if we can't find the file
Expand Down

0 comments on commit fca9d74

Please sign in to comment.