+
Skip to content

Conversation

ningyuxin1999
Copy link
Contributor

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

  • This comment contains a description of changes (with reason)
  • CHANGELOG.md is updated
  • If you've fixed a bug or added code that should be tested, add tests!
  • Documentation in docs is updated

@ningyuxin1999 ningyuxin1999 requested a review from a team July 28, 2025 14:07
Copy link

codecov bot commented Jul 28, 2025

Codecov Report

❌ Patch coverage is 60.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.74%. Comparing base (15aeedd) to head (6b71393).
⚠️ Report is 1 commits behind head on dev.

Files with missing lines Patch % Lines
nf_core/pipelines/lint/rocrate_readme_sync.py 60.00% 4 Missing ⚠️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@mirpedrol mirpedrol left a 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?

Comment on lines 41 to 43
# Ensure the fix rocrate_readme_sync is in the fix list
if "rocrate_readme_sync" not in self.fix:
self.fix += ("rocrate_readme_sync",)
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Member

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:
Copy link
Member

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):
Copy link
Member

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?

Copy link
Contributor Author

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?

Copy link
Member

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.

Copy link
Contributor Author

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."
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载