Skip to content

Check new code only #277

@robbat2

Description

@robbat2

This is going to take a bit of doing, but was wondering about the conceptual parts of it first.

When adding pre-commit to an existing codebase, there can be a lot of errors, and you still want to prevent introduction of new errors, plus whittle down the existing errors over time.

To that end, a mode that excludes errors due to pre-existing code, and only flags errors in new commits.

I can see a few ways that this could be mostly accomplished, but not reliably:

  • parse/filter checker output for lines that were added (EASY)
  • run checkers twice on old & new code, adjusting line numbers from old to new, and exclude errors that occured in both (MEDIUM)
  • teaching checkers to only care about a range of lines (HARD)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions