Skip to content

Commit

Permalink
Detect Containerfiles as Dockerfiles (rouge-ruby#2059)
Browse files Browse the repository at this point in the history
Co-authored-by: Andrew Hills <[email protected]>
  • Loading branch information
ahills and Andrew Hills authored Jul 15, 2024
1 parent 93e2bae commit 04887af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rouge/lexers/docker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ class Docker < RegexLexer
title "Docker"
desc "Dockerfile syntax"
tag 'docker'
aliases 'dockerfile', 'Dockerfile'
filenames 'Dockerfile', '*.Dockerfile', '*.docker'
aliases 'dockerfile', 'Dockerfile', 'containerfile', 'Containerfile'
filenames 'Dockerfile', '*.Dockerfile', '*.docker', 'Containerfile', '*.Containerfile'
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 @@ -11,6 +11,8 @@
assert_guess :filename => 'Dockerfile'
assert_guess :filename => 'docker.docker'
assert_guess :filename => 'some.Dockerfile'
assert_guess :filename => 'Containerfile'
assert_guess :filename => 'some.Containerfile'
end

it 'guesses by mimetype' do
Expand Down

0 comments on commit 04887af

Please sign in to comment.