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

Add ratcheting (gradual adoptance) #8

Closed
slarse opened this issue Apr 19, 2021 · 1 comment · Fixed by #41
Closed

Add ratcheting (gradual adoptance) #8

slarse opened this issue Apr 19, 2021 · 1 comment · Fixed by #41
Labels
enhancement New feature or request

Comments

@slarse
Copy link
Collaborator

slarse commented Apr 19, 2021

We need to make it possible to only consider introduced violations, i.e. violations that are contained in edited source code. This is commonly referred to as "ratchet". I've used it with success with Spotless, and think we can draw inspiration from there.

@slarse slarse added the enhancement New feature or request label Apr 19, 2021
@slarse slarse changed the title Add ratchetting (gradual adoptance) Add ratcheting (gradual adoptance) Apr 19, 2021
@slarse
Copy link
Collaborator Author

slarse commented Apr 28, 2021

I've found a few more things I need to implement ratchet:

  • git.Repo.diff() must take an optional argument commitish which specifies what commit-ish to compare against
    • This is to enable custom ratchet-from targets
  • It must be possible to get the worktree root of a repo, e.g. git.Repo.getWorktreeRoot()
    • This is necessary in order to match filepaths reported by git diff to those reported by Sorald
    • Can be implemented as git rev-parse --show-toplevel
  • A function that checks closed ranges for overlap.
    • For example, given a range [10, 17] and another range [15, 20] there is overlap, but for [10, 17] and [8, 9], there is no overlap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant