Skip to content

Commit

Permalink
Add filename extensions to Docker lexer (#1059)
Browse files Browse the repository at this point in the history
This commit:

* adds the *.Dockerfile filename extension; and
* adds the Dockerfile_* filename extension.

It fixed #1070.
  • Loading branch information
webmaster777 authored and pyrmont committed May 28, 2019
1 parent e5ec8df commit 4e5e248
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rouge/lexers/docker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Docker < RegexLexer
desc "Dockerfile syntax"
tag 'docker'
aliases 'dockerfile'
filenames 'Dockerfile', '*.docker'
filenames 'Dockerfile', '*.Dockerfile', '*.docker', 'Dockerfile_*'
mimetypes 'text/x-dockerfile-config'

KEYWORDS = %w(
Expand Down
2 changes: 2 additions & 0 deletions spec/lexers/docker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
it 'guesses by filename' do
assert_guess :filename => 'Dockerfile'
assert_guess :filename => 'docker.docker'
assert_guess :filename => 'some.Dockerfile'
assert_guess :filename => 'Dockerfile_some_extension'
end

it 'guesses by mimetype' do
Expand Down

0 comments on commit 4e5e248

Please sign in to comment.