Repository navigation
Fix lint and update crash when module patch removes YAML separators - #4617
Conversation
The check `line.startswith("---")` was meant to find file header lines
like `--- path/to/file`. But it also matched `----`, the line a patch
writes when a `---` line is removed. That line has no space, so
`line.split(" ")` failed and the code crashed.
The fix checks for `"--- "` (with a space) so that only the file header
lines are chosen.
Add a test that writes a small patch file with one header and one
removed `---` line, reads it with `per_file_patch`, and checks that the
result has only one file and that `----` is still kept as a change line.
Closes nf-core#3281
Codecov Report✅ All modified and coverable lines are covered by tests. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merging this PR will regress 1 benchmark1 warning
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
mashehu
left a comment
There was a problem hiding this comment.
Thanks for your contribution!
The check
line.startswith("---")was meant to find file header lines like--- path/to/fileinper_file_patch. But it also matched----, the line a patch writes when a---line is removed. That line has no space, soline.split(" ")failed and the code crashed.The fix checks for
"--- "(with a space) so that only the file header lines are chosen. Added a test that writes a small patch file with one header and one removed---line, reads it withper_file_patch, and checks that the result has only one file and that----is still kept as a change line. Closes #3281.PR checklist
CHANGELOG.mdis updatedAI use
Used Claude Code to find the bug and used it as a tutor and to check my work for accuracy and formatting. I wrote the test, fix and every communication line. I've reviewed and understand all the changes.