Skip to content
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

Check new code only #277

Open
robbat2 opened this issue Oct 30, 2018 · 0 comments
Open

Check new code only #277

robbat2 opened this issue Oct 30, 2018 · 0 comments

Comments

@robbat2
Copy link

robbat2 commented Oct 30, 2018

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant