-
Notifications
You must be signed in to change notification settings - Fork 214
Automatically sync the Rocrate and README content during pipelines lint #3688
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
base: dev
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Hi!
I agree with automatically updating the ro-crate file, but I missed why --fix
is not available?
# Ensure the fix rocrate_readme_sync is in the fix list | ||
if "rocrate_readme_sync" not in self.fix: | ||
self.fix += ("rocrate_readme_sync",) |
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.
if we are not using the --fix
flag this can be removed, also the if
at line 61
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.
Hi! I think this fix flag is not necessary anymore if we automate the update process. I.e. all the changes would be synchronized anyway during linting (according to my understanding, sorry if I'm wrong about it).
And in this case --fix
is still available but always set to true, just in case we want to disable it again someday.
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 would remove it completely then, it makes the code more confusing to follow, at least for me 😄
# Compare the two strings and add a linting error if they don't match | ||
if readme_content != rc_description_graph: | ||
# If the --fix flag is set, you could overwrite the RO-Crate description with the README content: | ||
if "rocrate_readme_sync" in self.fix: |
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.
we don't need this check anymore
assert len(results.get("failed", [])) == 0 | ||
assert len(results.get("passed", [])) > 0 | ||
|
||
def test_rocrate_readme_sync_fail(self): |
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.
this test is still valid, no?
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 removed it because there won't be any "failed" cases anymore👀 shall I always keep the tests for all cases?
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.
We still have the error (at rocrate_readme_sync.py
line 66), so I would keep the test.
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.
There won't be failed cases if I remove all the checks such as if "rocrate_readme_sync" in self.fix: ...
, so I guess this test would anyway be not necessary anymore?
fixed.append("Mismatch fixed: RO-Crate description updated from `README.md`.") | ||
else: | ||
failed.append( | ||
"The RO-Crate descriptions do not match the README.md content. Use `nf-core pipelines lint --fix rocrate_readme_sync` to update." |
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.
update the error to remove mention to --fix
flag
Sync the content automatically when there's any changes in the README file, as mentioned here. The flag
--fix
is not available for this case anymore.PR checklist
CHANGELOG.md
is updateddocs
is updated