-
Notifications
You must be signed in to change notification settings - Fork 214
Testing out Reftrace for regex replacement in modules #3745
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
… 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>
Codecov Report❌ Patch coverage is
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
||
|
||
def check_process_labels(self, lines): | ||
def check_process_labels(self, mod): |
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.
basic_process = """process TEST_PROCESS { | ||
label 'process_high' | ||
input: | ||
path input_file | ||
output: | ||
path "output.txt" | ||
script: | ||
''' | ||
echo "test" > output.txt | ||
''' | ||
} |
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 os.path.exists(temp_file.name): | ||
os.unlink(temp_file.name) |
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.
use pathlib please
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
CHANGELOG.md
is updateddocs
is updated