https://github.com/beoliver/diff-lint
Only display lint errors that you have caused
https://github.com/beoliver/diff-lint
Last synced: 7 months ago
JSON representation
Only display lint errors that you have caused
- Host: GitHub
- URL: https://github.com/beoliver/diff-lint
- Owner: beoliver
- License: apache-2.0
- Created: 2023-05-08T20:40:20.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-05-17T05:24:50.000Z (over 2 years ago)
- Last Synced: 2025-01-29T06:49:05.199Z (12 months ago)
- Language: Clojure
- Size: 23.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# diff-lint
Only display lint errors that you have caused.
## What does it do?
1. Runs `git diff` to get the files that have changed.
2. Runs `clj-kondo` on the changed files.
3. Stashes any changes.
5. Runs `clj-kondo` on the same files (if present) as step 2.
6. Uses the diff from step 1 to compute which linting errors are new.
7. Restores the original state of the repository.
8. Displays the linting errors.
You can then click on an error message to open the file in your editor.
## Why?
I want to quickly see the linting warnings/errors that I have caused. I don't want to see the linting errors that were already present in the codebase.
I want to know (best effort) if I have **indirectly** introduced a linting error. For example, if I change a function signature, I want to know if I have caused any linting errors in the code that calls that function. This approach is not perfect, but it works for local (ie file) changes and is quite fast.
## How to use
I just have an alias in my `~/.zshrc`
```sh
alias dl='time bb -f ~/dev/beoliver/diff-lint/diff_lint.clj -- $PWD'
```