8000 Refactor linting code · Issue #805 · nf-core/tools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Refactor linting code #805
Closed
Closed
@ewels

Description

@ewels

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:

  • Use text-based test names instead of numeric
    • Test numbers seemed simple at the start, but it means that you can't insert a new test in a logical spot in the middle of the code without disrupting all numbers that follow
    • Can use short IDs, maybe correspond to function name?
  • Break up some of the larger lint tests
    • Some of the tests have grown quite a bit over time and a single test can encompass a lot of sub-checks (eg. check_nextflow_config()) - it would be good to break these up into nice small chunks
  • Look for a nf-core linting yaml config file in the pipeline (eg. .nf-core-lint.yml)
    • Allow any test to be ignored, eg. check_docker: false
    • Allow test-specific sub-tests to be ignored, where applicable. eg. check_files_exist: { ignore: ['README.md'] }
    • Other nice customisation stuff wherever we can think of it.. eg. checking for a string other than nf-core in manifest.name config etc.. (could include global options?)
    • Can model this on how markdownlint rules work - eg. this config file
    • Generally I like hiding dotfiles like this away somewhere so as not to pollute the repo root directory. But I think it's important that this one is super visible so that it's easy to see which rules are being ignored. So maybe .nf-core-lint.yml in the root is a good idea here.
    • Good logging about what's being skipped will be important, maybe also in reporting at end / GitHub comment etc?
  • Rewrite the python tests (test_lint.py) to be much more self-isolated
    • Make each test independent to the rest, as much as possible
    • Remove the need to maintain the lint_examples directories
    • Get rid of the MAX_PASS_CHECKS thing, which is super annoying
    • Will probably need to refactor functions in lint.py to return a set of results, instead of modifying self

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0