-
Notifications
You must be signed in to change notification settings - Fork 192
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
Make nf-core modules update --save-diff
work when files are created or removed
#1698
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #1698 +/- ##
==========================================
- Coverage 68.24% 68.23% -0.01%
==========================================
Files 56 57 +1
Lines 6694 6746 +52
==========================================
+ Hits 4568 4603 +35
- Misses 2126 2143 +17
Continue to review full report at Codecov.
|
nf-core modules update --save-diff
work when files where created or removednf-core modules update --save-diff
work when files are created or removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it looks good! I found a small error while testing the command that should be addressed.
Also, I've seen that when I create a file to test what happens when a file needs to be removed, it works fine with --preview
or updating directly, but it's not removed with the option --save-diff
.
To reproduce:
git clone https://github.com/nf-core/rnaseq.git
cd rnaseq
nf-core modules update cat/fastq --sha 49da8642876ae4d91128168cd0db4f1c858d7792
touch modules/nf-core/modules/cat/fastq/test.yml
nf-core modules update --save-diff diff.file cat/fastq
grep "test.yml" diff.file
# test.yml file is not listed in diff.file
# Note that functions.py file is indeed removed as expected
nf-core modules update --preview cat/fastq
# test.yml file is listed in the preview and removed
If you think this is out of this PR scope, we can take a look in a different one :)
Good points, I've added recursive checking of the module directory now. Regarding the your first example: The issue here is that the --- modules/nf-core/modules/cat/fastq/test.yml
+++ /dev/null
@@ -0,0 +0,0 @@ to try to coerce |
I see the problem. Let's assume we won't usually have empty files :) |
Sounds good! If it becomes a major issue somewhere, we can have a second look at it. |
As I reported in #1694,
nf-core modules update --save-file
simply ignored files that were created or removed between updates. I've fixed this by letting the output.diff
file be more similar to the output fromgit diff
:/dev/null
a/
andb/
respectively.I've moved the diff methods in
update
to a separate static class to make the update code a bit cleaner alsoPR checklist
CHANGELOG.md
is updateddocs
is updated