+
Skip to content

Lint for version captures in modules #3676

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

Draft
wants to merge 13 commits into
base: dev
Choose a base branch
from
Draft

Conversation

edmundmiller
Copy link
Contributor

@edmundmiller edmundmiller commented Jul 11, 2025

Waiting on #3592 to get merged.

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

…dling

- Renamed test functions for clarity.
- Introduced DummyModule and DummyLint classes to simulate module and lint behavior.
- Enhanced tests for handling invalid, empty, and missing dependencies in environment.yml files.
- Improved assertions to validate sorting and schema compliance.
- Replaced yaml library with ruamel.yaml for improved YAML processing.
- Added schema validation for environment.yml files.
- Implemented sorting for dependencies and channels, ensuring proper order.
- Updated file writing to include schema lines and sorted content.
- Enhanced logging for sorting actions and validation results.
…processing

- Updated the YAML library from ruamel.yaml to PyYAML for improved compatibility.
- Changed YAML loading to use safe_load for better security.
- Enhanced YAML dumping with specific formatting options for clarity.
- Adjusted error handling to reflect the new library usage.
Did my best, and wanted to keep the code verbatim before things really start shifting.
… version handling

- Introduced separate test files for module changes, deprecations, todos, and version functionalities.
- Implemented basic structure and placeholder tests for each new test file to ensure future functionality can be added.
- Removed the old test_lint.py file to streamline the test organization.
…ssed tests

- Updated the assertion to verify the presence of "test_snap_md5sum" in the passed tests.
- Improved handling to accommodate both LintResult objects and tuple formats for better robustness.
@edmundmiller edmundmiller self-assigned this Jul 11, 2025
Add new lint check `test_snap_version_content` to ensure version information
in test snapshots contains actual content instead of MD5/SHA hash values.
This addresses the issue where version snapshots were storing hash values
like "versions.yml:md5,949da9c6297b613b50e24c421576f3f1" instead of
actual version content like {"ALE": {"ale": "20180904"}}.

Changes:
- Add version content validation in module_tests.py with regex patterns
- Add comprehensive tests for both invalid (hash) and valid (content) cases
- Add pytest issue marker support for linking tests to GitHub issues
- Update pyproject.toml with new pytest marker configuration

Fixes: nf-core/modules#6505

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link
Contributor

@mashehu mashehu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will have a deeper look once the two other PRS it contains are cleared up.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want to have too much agent generated code for this repo, because it is too finicky and too deeply integrated into everything nf-core. So please remove this file. 😬

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

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