├── .github └── workflows │ └── test.yml ├── .gitignore ├── LICENSE ├── Preferences └── Dockerfile.tmPreferences ├── README.md ├── Syntaxes ├── Dockerfile-bash.sublime-syntax ├── Dockerfile.sublime-syntax └── Dockerfile.tmLanguage └── info.plist /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Syntax Tests 2 | 3 | on: 4 | push: 5 | paths: 6 | - '.github/workflows/test.yml' 7 | - '**.sublime-syntax' 8 | - '**/syntax_test*' 9 | - '**.tmPreferences' 10 | pull_request: 11 | paths: 12 | - '.github/workflows/test.yml' 13 | - '**.sublime-syntax' 14 | - '**/syntax_test*' 15 | - '**.tmPreferences' 16 | 17 | jobs: 18 | syntax_tests: 19 | name: Run Syntax Tests 20 | runs-on: ubuntu-latest 21 | steps: 22 | - uses: actions/checkout@v2 23 | 24 | - uses: SublimeText/syntax-test-action@v2 25 | with: 26 | build: 4121 27 | default_packages: v4121 28 | package_name: Dockerfile Syntax Highlighting 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.cache 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright 2014 Asbjorn Enge 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /Preferences/Dockerfile.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Comments 7 | scope 8 | source.dockerfile 9 | settings 10 | 11 | shellVariables 12 | 13 | 14 | name 15 | TM_COMMENT_START 16 | value 17 | # 18 | 19 | 20 | 21 | uuid 22 | 2B215AC0-A7F3-4090-9FF6-F4842BD56CA7 23 | 24 | 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Docker.tmbundle 2 | 3 | Dockerfile syntax highlighting for TextMate and Sublime Text. 4 | 5 | ## Install 6 | 7 | ### Sublime Text 8 | 9 | Available for Sublime Text under [package control](https://sublime.wbond.net/packages/Dockerfile%20Syntax%20Highlighting). 10 | Search for *Dockerfile Syntax Highlighting* 11 | 12 | ### TextMate 2 13 | 14 | You can install this bundle in TextMate by opening the preferences and going to the bundles tab. After installation it will be automatically updated for you. 15 | 16 | enjoy. 17 | 18 | ### Changelog 19 | 20 | #### 1.3.0 21 | 22 | * Added invalid newlines highlighting 23 | 24 | #### 1.2.0 25 | 26 | * Updated with latest keywords 27 | 28 | #### 1.0.1 29 | 30 | * Added `Dockerfile.sublime-syntax`, converted from tmLanguage 31 | 32 | #### 1.0.0 33 | 34 | * Started doing version tags 35 | * Added `ARG` instruction 36 | 37 | ### License 38 | 39 | Copyright 2014 Asbjorn Enge 40 | 41 | Permission is hereby granted, free of charge, to any person obtaining a copy 42 | of this software and associated documentation files (the "Software"), to deal 43 | in the Software without restriction, including without limitation the rights 44 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 45 | copies of the Software, and to permit persons to whom the Software is 46 | furnished to do so, subject to the following conditions: 47 | 48 | The above copyright notice and this permission notice shall be included in 49 | all copies or substantial portions of the Software. 50 | 51 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 52 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 53 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 54 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 55 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 56 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 57 | THE SOFTWARE. 58 | -------------------------------------------------------------------------------- /Syntaxes/Dockerfile-bash.sublime-syntax: -------------------------------------------------------------------------------- 1 | %YAML 1.2 2 | --- 3 | # http://www.sublimetext.com/docs/syntax.html 4 | name: Dockerfile (with bash) 5 | 6 | scope: source.dockerfile.bash 7 | 8 | variables: 9 | identifier: '[[:alnum:]]+' 10 | onbuild_directive: (?i:(onbuild)\s+)? 11 | onbuild_commands_directive: 12 | "{{onbuild_directive}}(?i:add|arg|env|copy|expose|healthcheck|label|shell|stopsignal|user|volume|workdir)" 13 | nononbuild_commands_directive: (?i:maintainer) 14 | embeddable_directive: '{{onbuild_directive}}(?i:run|cmd|entrypoint)' 15 | from_directive: (?i:(from))\s+[^\s:@]+(?:[:@](\S+))?(?:\s+(?i:(as))\s+(\S+))? 16 | 17 | contexts: 18 | main: 19 | - include: comments 20 | - match: ^(?i:arg)\s 21 | scope: keyword.control.dockerfile 22 | - include: from 23 | 24 | expect-container-tag: 25 | - match: ({{identifier}}(?:/{{identifier}})?)(?:([:@])(\S+))? 26 | captures: 27 | 1: entity.name.label.dockerfile 28 | 2: punctuation.separator.dockerfile 29 | 3: constant.numeric.dockerfile 30 | pop: true 31 | 32 | from: 33 | - match: ^{{from_directive}} 34 | captures: 35 | 1: keyword.control.from.dockerfile 36 | 2: entity.name.enum.tag-digest 37 | 3: keyword.control.dockerfile 38 | 4: variable.stage-name 39 | push: body 40 | 41 | body: 42 | - include: comments 43 | - include: directives 44 | - include: from 45 | - include: invalid 46 | 47 | directives: 48 | - match: ^\s*({{embeddable_directive}})\b 49 | captures: 50 | 1: keyword.control.dockerfile 51 | push: 52 | - match: (?=\s*\[) 53 | set: scope:source.json#arrays 54 | with_prototype: 55 | - match: \n 56 | pop: true 57 | - match: "" 58 | set: scope:source.shell.bash 59 | with_prototype: 60 | - include: scope:source.shell.bash#prototype 61 | - match: \n|^(?=\S) 62 | pop: true 63 | - match: ^\s*{{onbuild_commands_directive}}\s 64 | captures: 65 | 0: keyword.control.dockerfile 66 | 1: keyword.other.special-method.dockerfile 67 | push: scope:source.shell.bash#cmd-args 68 | - match: ^\s*{{nononbuild_commands_directive}}\s 69 | scope: keyword.control.dockerfile 70 | push: scope:source.shell.bash#cmd-args 71 | 72 | invalid: 73 | - match: ^[^A-Z\n](.*)$ 74 | scope: invalid.illegal.dockerfile 75 | 76 | comments: 77 | - match: ^(\s*)((#).*$\n?) 78 | comment: comment.line 79 | captures: 80 | 1: punctuation.whitespace.comment.leading.dockerfile 81 | 2: comment.dockerfile 82 | 3: punctuation.definition.comment.dockerfile 83 | -------------------------------------------------------------------------------- /Syntaxes/Dockerfile.sublime-syntax: -------------------------------------------------------------------------------- 1 | %YAML 1.2 2 | --- 3 | # http://www.sublimetext.com/docs/3/syntax.html 4 | name: Dockerfile 5 | scope: source.dockerfile 6 | 7 | file_extensions: 8 | - Dockerfile 9 | - dockerfile 10 | 11 | hidden_file_extensions: 12 | - .Dockerfile 13 | 14 | first_line_match: ^\s*(?i:(from(?!\s+\S+\s+import)|arg))\s+ 15 | 16 | variables: 17 | onbuild_directive: (?i:(onbuild)\s+)? 18 | onbuild_commands_directive: 19 | "{{onbuild_directive}}(?i:add|arg|env|expose|healthcheck|label|run|shell|stopsignal|user|volume|workdir)" 20 | nononbuild_commands_directive: (?i:maintainer) 21 | runtime_directive: "{{onbuild_directive}}(?i:cmd|entrypoint)" 22 | from_directive: (?i:(from))\s+[^\s:@]+(?:[:@](\S+))?(?:\s+(?i:(as))\s+(\S+))? 23 | copy_directive: ({{onbuild_directive}}(?i:copy))(?:\s+--from=(\S+))? 24 | 25 | contexts: 26 | main: 27 | - include: comments 28 | - match: ^(?i:arg)\s 29 | scope: keyword.control.dockerfile 30 | - include: from 31 | 32 | from: 33 | - match: ^{{from_directive}} 34 | captures: 35 | 1: keyword.control.from.dockerfile 36 | 2: entity.name.enum.tag-digest 37 | 3: keyword.control.dockerfile 38 | 4: variable.stage-name 39 | push: body 40 | 41 | body: 42 | - include: comments 43 | - include: directives 44 | - include: invalid 45 | - include: from 46 | 47 | directives: 48 | - match: ^\s*{{onbuild_commands_directive}}\s 49 | captures: 50 | 0: keyword.control.dockerfile 51 | 1: keyword.other.special-method.dockerfile 52 | push: args 53 | - match: ^\s*{{nononbuild_commands_directive}}\s 54 | scope: keyword.control.dockerfile 55 | push: args 56 | - match: ^\s*{{copy_directive}}\s 57 | captures: 58 | 1: keyword.control.dockerfile 59 | 2: keyword.other.special-method.dockerfile 60 | 3: variable.stage-name 61 | push: args 62 | - match: ^\s*{{runtime_directive}}\s 63 | captures: 64 | 0: keyword.operator.dockerfile 65 | 1: keyword.other.special-method.dockerfile 66 | push: args 67 | 68 | escaped-char: 69 | - match: \\. 70 | scope: constant.character.escaped.dockerfile 71 | 72 | args: 73 | - include: comments 74 | - include: escaped-char 75 | - match: ^\s*$ 76 | - match: \\\s+$ 77 | - match: \n 78 | pop: true 79 | - match: '"' 80 | scope: punctuation.definition.string.begin.dockerfile 81 | push: double_quote_string 82 | - match: "'" 83 | scope: punctuation.definition.string.begin.dockerfile 84 | push: single_quote_string 85 | 86 | double_quote_string: 87 | - meta_scope: string.quoted.double.dockerfile 88 | - include: escaped-char 89 | - match: ^\s*$ 90 | - match: \\\s+$ 91 | - match: \n 92 | set: invalid 93 | - match: '"' 94 | scope: punctuation.definition.string.end.dockerfile 95 | pop: true 96 | 97 | single_quote_string: 98 | - meta_scope: string.quoted.single.dockerfile 99 | - include: escaped-char 100 | - match: ^\s*$ 101 | - match: \\\s+$ 102 | - match: \n 103 | set: invalid 104 | - match: "'" 105 | scope: punctuation.definition.string.end.dockerfile 106 | pop: true 107 | 108 | comments: 109 | - match: ^(\s*)((#).*$\n?) 110 | comment: comment.line 111 | captures: 112 | 1: punctuation.whitespace.comment.leading.dockerfile 113 | 2: comment.dockerfile 114 | 3: punctuation.definition.comment.dockerfile 115 | 116 | invalid: 117 | - match: ^[^A-Z\n](.*)$ 118 | scope: invalid 119 | set: body 120 | -------------------------------------------------------------------------------- /Syntaxes/Dockerfile.tmLanguage: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fileTypes 6 | 7 | Dockerfile 8 | 9 | name 10 | Dockerfile 11 | patterns 12 | 13 | 14 | match 15 | \\. 16 | name 17 | constant.character.escaped.dockerfile 18 | 19 | 20 | captures 21 | 22 | 1 23 | 24 | name 25 | keyword.control.dockerfile 26 | 27 | 2 28 | 29 | name 30 | keyword.other.special-method.dockerfile 31 | 32 | 33 | match 34 | ^\s*(?:(ONBUILD)\s+)?(ADD|ARG|CMD|COPY|ENTRYPOINT|ENV|EXPOSE|FROM|HEALTHCHECK|LABEL|MAINTAINER|RUN|SHELL|STOPSIGNAL|USER|VOLUME|WORKDIR)\s 35 | 36 | 37 | captures 38 | 39 | 1 40 | 41 | name 42 | keyword.operator.dockerfile 43 | 44 | 2 45 | 46 | name 47 | keyword.other.special-method.dockerfile 48 | 49 | 50 | match 51 | ^\s*(?:(ONBUILD)\s+)?(CMD|ENTRYPOINT)\s 52 | 53 | 54 | begin 55 | " 56 | beginCaptures 57 | 58 | 1 59 | 60 | name 61 | punctuation.definition.string.begin.dockerfile 62 | 63 | 64 | end 65 | " 66 | endCaptures 67 | 68 | 1 69 | 70 | name 71 | punctuation.definition.string.end.dockerfile 72 | 73 | 74 | name 75 | string.quoted.double.dockerfile 76 | patterns 77 | 78 | 79 | match 80 | \\. 81 | name 82 | constant.character.escaped.dockerfile 83 | 84 | 85 | 86 | 87 | begin 88 | ' 89 | beginCaptures 90 | 91 | 1 92 | 93 | name 94 | punctuation.definition.string.begin.dockerfile 95 | 96 | 97 | end 98 | ' 99 | endCaptures 100 | 101 | 1 102 | 103 | name 104 | punctuation.definition.string.end.dockerfile 105 | 106 | 107 | name 108 | string.quoted.single.dockerfile 109 | patterns 110 | 111 | 112 | match 113 | \\. 114 | name 115 | constant.character.escaped.dockerfile 116 | 117 | 118 | 119 | 120 | captures 121 | 122 | 1 123 | 124 | name 125 | punctuation.whitespace.comment.leading.dockerfile 126 | 127 | 2 128 | 129 | name 130 | comment.line.number-sign.dockerfile 131 | 132 | 3 133 | 134 | name 135 | punctuation.definition.comment.dockerfile 136 | 137 | 138 | comment 139 | comment.line 140 | match 141 | ^(\s*)((#).*$\n?) 142 | 143 | 144 | scopeName 145 | source.dockerfile 146 | uuid 147 | a39d8795-59d2-49af-aa00-fe74ee29576e 148 | 149 | 150 | -------------------------------------------------------------------------------- /info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | contactEmailRot13 6 | germ@andz.com.ar 7 | contactName 8 | GermanDZ 9 | description 10 | Helpers for Docker. 11 | name 12 | Docker 13 | uuid 14 | 8B9DDBAF-E65C-4E12-FFA7-467D4AA535B1 15 | 16 | 17 | --------------------------------------------------------------------------------