nf-core / nf-core/tools

nf-core lint check that snapshots are used

Open
#2,504 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

linting modules nf-test
Dominant language
Python
Stars
322
Forks
255
Avg merge
2d 3h
Merged PRs (30d)
5

Description

I think we can check for any use of md5 or contains in the assert statements and warn/fail on those. I haven't seen a reason not to use a snapshot(yet). Happy to be proven wrong, if so:

                // nf-core-ignore: 186 Can't snapshot because the output is huge, etc.
                { assert process.out.npa.get(0).get(1) ==~ ".*/test.npa" },
                { assert process.out.npc.get(0).get(1) ==~ ".*/test.npc" },
                { assert path(process.out.npo.get(0).get(1)).getText().contains("# @impl: Nonpareil") },
                { assert path(process.out.npl.get(0).get(1)).md5 == "be95453a272a9f685d5695d2b391fde8" },

or something to by-pass it

Original conversation https://github.com/nf-core/modules/pull/4313/files#r1386762562

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing lint-check entry point for assertions and its test coverage. Add coverage for assertions using md5 or contains, including the proposed nf-core-ignore bypass, and verify that the check warns or fails as intended.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.