Remove Dockerfile_ file glob from Docker lexer #1550
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In addition to adding the
*.Dockerfile
file glob, #1059 added a file glob forDockerfile_*
to address #1070. However, as noted by #1539, this causes issues for files that begin withdockerfile_
but that are not Dockerfiles.While I am the one that merged #1059, I now believe it was a mistake to add the
Dockerfile_*
file glob and it should be removed. This is a non-standard name and is not recognised by other lexing libraries (see Pygments, Chroma, Linguist). I was not aware of this feature at the time but the correct fix for the issue that precipitated #1070 is to use a.gitattributes
file as explained here.While this is technically a breaking change and should wait for the Rouge 4.0 release, I think it makes sense to characterise it as a bug that can be fixed as part of the next release of Rouge 3.0.
This fixes #1539.