`lang:Dockerfile` not working as expected (does not find `Dockerfile`s)
Created by: NiclasvanEyk
- Sourcegraph version: Sourcegraph.com
- Platform information: MacOS Big Sur 11.4, Firefox 91.0.2 (but I don't think this is platform dependant)
Steps to reproduce:
- Execute a search using the
lang:Dockerfile
filter, e.g. for the sourcegraph/sourcegraph repository on Github - Use the same search, but exchange the
lang:Dockerfile
filter forfile:Dockerfile
, e.g. the same example as in search 1 with exchanged filters
Expected behavior:
Search (1) and (2) should yield similar results, especially for files called Dockerfile
.
Actual behavior:
Search (1) does not yield any results, while search (2) correctly finds all Dockerfiles.
It seems like the lang:Dockerfile
filter only takes the file extension into account. For example, when I do not limit the search to a particular repository and apply lang:Dockerfile
(link), only files like something.Dockerfile
, so ones containing the .Dockerfile
suffix are returned. This is even more obvious when also applying file:^Dockerfile$
(link), which yields no results.
Additional notes
The syntax highlighting seems to have similar issues, just the other way around: A file called Dockerfile
is highlighted correctly, while a file with a .Dockerfile
suffix does not get highlighted at all.
Also other languages with similar naming conventions suffer from such issues. A search containing lang:Makefile
only yields files with a .mk
extension, but most makefiles will be just named Makefile
, which are found when using file:^Makefile$
, but applying both lang:Makefile
and file:^Makefile$
yields no results.
Given that Dockerfile
is the convention/default filename used by the docker
cli, I think that a search containing lang:Dockerfile
should also return those files as a result.