-
Notifications
You must be signed in to change notification settings - Fork 192
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
Refactor linting code #805
Comments
@szymonwieloch this might be of interest to you! |
Had a closer look at Text-based test namesShould be as easy as switching the numbers by text-based keys (also in the website, of course). Break up larger lint testsI went through all the tests to see what could be broken up. The That is if we decide to outsource the conda/docker checks to the module linting. The module lint function could then be called by the Linting configuration fileI think it would be nice to have a field in the Checking whether to run the function could be done by either cleaning the list of tests prior to looping through it, or by checking in the functions themselves. Although I think the former would be cleaner. rewrite python testsI think this is the trickiest one. Regarding making it more self-isolated, I assume you mean that all tests are using the same directories for testing, right? Because otherwise I can't see how the tests depend on one another. Could of course modify the functions to return results and then store this in a dict. Not sure about the benefit of that though? 🤔 Will have a bit more thought about it and then get to work, probably on Monday. |
Sorry all, I couldn't help myself and got started. See #809 👈🏻 |
Ok had a bit of fun today with this and have made a start on #809. Still more to do if anyone gets a chance though. I was finding the I don't think that there is any way around the grunt work for the tests. It's just a case of going through them all and rewriting. I made a start on a few and already found some presumably long-standing problems where tests were being ignored incorrectly. So I think that some of these won't have been running for ages in some cases (eg. if you're not running from within the pipeline dir). So just because we have code coverage doesn't mean that the tests are necessarily doing anything useful 😓 I did pretty much what you suggested for the tests @KevinMenden - wrote a Because I refactored the lint functions to return a dict instead of appending to lists in the main object, it is now pretty easy to just check the results of that one test function. This is what I meant about them being more isolated - before all results were kept globally, so if you added one test anywhere it would mess up the expected counts for all lint test pytests. Now you can inspect the returned results from each individual test which is much better. |
I think we can close this issue now. It's quite broad but I think that most of it has been implemented and merged now. Main outstanding thing is that Test coverage has taken a big drop and it would be nice to try to bring it back up if we can at some point. |
The code for
nf-core lint
is pretty central to the nf-core community and is heavily used across all pipelines. It has grown over time and is now due a substantial refactor / rewrite. As I see it, the main points are:check_nextflow_config()
) - it would be good to break these up into nice small chunks.nf-core-lint.yml
)check_docker: false
check_files_exist: { ignore: ['README.md'] }
nf-core
inmanifest.name
config etc.. (could include global options?).nf-core-lint.yml
in the root is a good idea here.test_lint.py
) to be much more self-isolatedlint_examples
directoriesMAX_PASS_CHECKS
thing, which is super annoyinglint.py
to return a set of results, instead of modifyingself
Although of course it would be nice to try to break this work up into a bunch of smaller PRs, I suspect that a lot of it will have to be done all in one go as everything is tied together currently. One of the main aims of all of the above is to make the linting code a lot more atomic and thus easier to update / add to.
This issue supplants #389
The text was updated successfully, but these errors were encountered: