Skip to content

Re-implement ratchet checks on single checkouts #167

@wolfgangwalther

Description

@wolfgangwalther

Currently, the ratchet-type checks require two checkouts to work with and compare. If it fails in one, it's OK to fail in the other. This is a bit annoying to set up, especially when trying to run nixpkgs-vet on a local branch. nix-build ci -A nixpkgs-vet can't be branch-aware, thus we have a helper script in ci/nixpkgs-vet.sh.

I propose a different approach, which could be used for treefmt as well, when introducing new formatters, which might not pass on all files, yet:

  • Add something to ignore specific files (Add some way to ignore files #138)
  • Keep a list of "known failures" in nixpkgs and pass the ignore list to the check
  • Throw an error if any of the ignored files actually passes (to then nudge the user towards removing the file from the list)
  • Bonus points: Provide a --fix mode for that error, so that the ignore file is written to automatically.

This would allow step-by-step introduction of new rules in single checkouts, too. It would allow to easily run the same nixpkgs-vet locally as in CI. And it would allow to see the list of violating files for each tool quickly.

Especially the latter is not easy to do right now. The only way I came up with for nixpkgs-vet would be to compare your current checkout against a mostly empty checkout or so?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions