GitHub: Better Line Counts
Remove generated files from the total line counts on GitHub PRs
What is GitHub: Better Line Counts?
Stats
Chrome-Stats Rank
Other platforms
Summary
Isn't it annoying when you open a small PR, but when you look at the diff, it's +2000 -16 because you installed a new library? Or what if you had to review that PR, don't line counts like that dissuade you from starting the review?
In reality, lots of code is generated nowadays and GitHub's line counts are not representative of a PR's true size.
This extension subtracts generated files from the total line counts, giving you a better idea of how big a PR really is. That's it. That's all it does.
Generated files are detected from the branch's root .gitattributes file. See GitHub's docs to learn how to mark a file as generated: https://docs.github.com/en/repositories/working-with-files/managing-files/customizing-how-changed-files-appear-on-github
For a simple example, checkout this extension's .gitattributes file! https://github.com/aklinker1/github-better-line-counts/blob/main/.gitattributes
The extension is open source. Feel free to contribute if you have any ideas or just star it 😀 https://github.com/aklinker1/github-better-line-counts
Safety
Risk impact
GitHub: Better Line Counts may not be safe to use and it requires some risky permissions. Exercise caution when installing this add-on. Review carefully before installing.
Risk likelihood
GitHub: Better Line Counts is probably trust-worthy. Prefer other publishers if available. Exercise caution when installing this add-on.