exclude certain file types/extensions from line counts
Closed this issue ยท 5 comments
I have a feature request for you: the ability to exclude certain file types/extensions from your line count calculations (if this is possible based on GH app permissions.) I would like to exclude things like Jest snapshots, lock file changes, etc., as they tend to artificially inflate otherwise simple PRs.
And thanks again for this GH extension!
Definitely on my radar!
I'll try get this in within the next week.
๐
@nickbouton would you be ok with filtering a standard set of generated files?
I ported most of the linguist repo from GitHub (which they use to detect generated files) to a repo over here.
In order to read the .gitattributes
file in a repo, the GitHub app would need read access to a users repo (it currently just has PR read access). I think I would prefer to just to use a standard set of files for now. Don't really wanna ask for the additional permissions.
What do you think? If a custom set of files is needed, I could add those permissions to the app and write some code to parse the .gitattributes file.
PR open here: #4
@noqcks Hey Benji - appreciate you jumping on this so quickly. I believe you worked with my colleague at Klue, @apawson. (At least, that's what he tells me, should I choose to believe him. He's pretty devious. ๐)
I had a couple of thoughts on this:
-
I think your suggestion of a standard set of excluded files and not requiring read-access to repos would make sense in terms of ease-of-distribution. It's probably also the simplest approach in the short-term.
-
Having zero (
0
) knowledge about how GitHub "Apps" work, I see a configuration screen in there when I look at your app:My thought there is ... is there any way to make use of that area for configuration, without necessitating full read access to the installed repo?
Apparently you can ask for read-only permissions for a single file!
I've added the ability to use custom generated files if specified in .gitattributes
in this commit on #4.
I'm much more comfortable requesting only this permission for repositories.
@noqcks Nice! Agree on the perms front, the more limited the better.