+
Skip to content

Conversation

ningyuxin1999
Copy link
Contributor

I've been trying testing out how to use Reftrace to replace some regex linting logic. So far I started with the process label checks using the Python API. (The previous draft PR was closed after the test restructure)

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

edmundmiller and others added 10 commits September 3, 2025 17:07
… linting

Replace regex-based process label validation with structured parsing using
the Reftrace library. This provides more accurate parsing of Nextflow syntax
and better error handling.

Key changes:
- Enhanced MockModuleLint to create temporary files for Reftrace compatibility
- Updated check_process_labels to use Reftrace Module objects instead of raw lines
- Modified integration to parse modules with Reftrace and handle parse errors
- Updated unit tests to create proper Nextflow syntax files for testing

Addresses Yuxin's challenge with integrating Reftrace into the testing
infrastructure while maintaining the existing linting functionality.

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

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

codecov bot commented Sep 23, 2025

Codecov Report

❌ Patch coverage is 88.46154% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.24%. Comparing base (f58c564) to head (4de14dc).

Files with missing lines Patch % Lines
nf_core/modules/lint/main_nf.py 85.71% 3 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.



def check_process_labels(self, lines):
def check_process_labels(self, mod):
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick
could you please add type hints to the function?

Comment on lines +21 to +34
basic_process = """process TEST_PROCESS {
label 'process_high'
input:
path input_file
output:
path "output.txt"
script:
'''
echo "test" > output.txt
'''
}
Copy link
Contributor

Choose a reason for hiding this comment

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

thought
how about using modules.create here, so we have some sanity check against the template. or do we need to remove too much boilerplate code because the template skeleton is not complete enough?

Comment on lines +107 to +108
if os.path.exists(temp_file.name):
os.unlink(temp_file.name)
Copy link
Contributor

Choose a reason for hiding this comment

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

use pathlib please

@mirpedrol mirpedrol modified the milestones: 3.4.0, 3.5.0 Oct 2, 2025
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.

5 participants

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