Feature request: custom filter for PR files

When I’m reviewing the files of a PR, there is a “File filter” drop down, which lets me filter the files shown by the filename extension (like “only show .js files”)

This doesn’t give me the granularity I’m looking for, like in the following use case:

  • In my project we have a naming standard for unit tests, where unit tests are .js files within a __test___ folder.
  • When I am initially reviewing a PR, I usually skip the tests and look only at the code, so I would like to hide all the files within __test__ folders.
  • A custom filter where I can type patterns to hide or show would be helpful. For example if I typed “!__test__” and it would hide the test files.
5 Likes

Hi Barelyfitz,

Thanks for this feedback! We’re always working to improve GitHub and the GitHub Community Forum, and we consider every suggestion we receive. I’ve logged your feature request in our internal feature request list.

Though I can’t guarantee anything or share a timeline for this, I can tell you that it’s been shared with the appropriate teams for consideration.

Please let me know if you have any other questions.

Cheers!

2 Likes

Just want to express that this is desired by multiple people.  I have a use case where my developers are using a “mono-repo” style development and would like to diff by directory (aka “project” for them).  On the command line git already supports this like:

git log a..b \<path\>  
git diff a..b \<path\>  

Looking around the internet people have made workarounds for GitHub

https://github.com/Mottie/GitHub-userscripts/wiki/GitHub-diff-files-filter

And asked about this on Stack Overflow 

* https://stackoverflow.com/questions/50218935/how-to-compare-two-directories-in-github
https://stackoverflow.com/questions/34899076/github-compare-view-for-a-specific-path-only

For myself if file-filters would match more than the extname then I think I’d be good.

5 Likes