-
Notifications
You must be signed in to change notification settings - Fork 219
Adding nf-core modules lint command
#842
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
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #842 +/- ##
==========================================
- Coverage 70.51% 69.79% -0.72%
==========================================
Files 33 34 +1
Lines 3680 4129 +449
==========================================
+ Hits 2595 2882 +287
- Misses 1085 1247 +162
Continue to review full report at Codecov.
|
|
By the way I've added the file comparison code as a function of the Or did you plan to have that code within this function: |
Co-authored-by: Harshil Patel <[email protected]>
ewels
left a comment
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.
Awesome work! Made a few changes but generally fairly happy now. I'm sure it'll need a lot more work still but I think it's fine to merge.
- Changed how lint tests are reported
- Gave everything a test id, so that we can add in the ability to ignore tests in the future with a config, and link to docs.
- Print results in a table with a column for file path, much easier to read
- Added
--alland if neither that nor tool name is given, run prompts to ask what to lint - Other stuff probably. It's late.
PR checklist
CHANGELOG.mdis updateddocsis updatedThis PR adds the command
nf-core modules lint <directory> <module>to nf-core.There are still some things to do, like adding tests, updating the docs and integrating with
nf-core lint, but I felt now is the right time to do at least a draft PR in case a different structure is desired :)Description
I have added a
ModuleLintclass in themodules.pyfile, which takes care of the linting. Given a directory, it checks whether it is a clone ofnf-core/modulesor a pipeline directory. In the former cases, it makes some checks for every module and also looks for the necessary test files. When additionally given a module name in the forsoftware/toolorsoftware(depending on the module), it only lints this module.When using on a nf-core pipeline directory, it performs the same checks for all modules installed from nf-core (except for the tests) and also runs some quick checks on the local modules (only issuing warnings here).
The
ModuleLint.lint()function returns a dict of{passed, warned, failed}which can be used to integrate the results directly intonf-core lint. When used on it's own it can also print similar results asnf-core lint(I basically copied the_print_resultscode :) )Alright, that's the current status. What's left to do:
nf-core lintI would be glad to get some feedback on further checks that could be implemented (or left-out) and of course let me if I should change something in the overall structure.