From 40ffe75bd2d3332babea1241001500a780bc6b62 Mon Sep 17 00:00:00 2001 From: Camden Cheek Date: Tue, 11 May 2021 10:03:36 -0600 Subject: Add config for Dockerfile parser (#1288) --- queries/dockerfile/highlights.scm | 50 +++++++++++++++++++++++++++++++++++++++ queries/dockerfile/injections.scm | 3 +++ 2 files changed, 53 insertions(+) create mode 100644 queries/dockerfile/highlights.scm create mode 100644 queries/dockerfile/injections.scm (limited to 'queries/dockerfile') diff --git a/queries/dockerfile/highlights.scm b/queries/dockerfile/highlights.scm new file mode 100644 index 00000000..1d629648 --- /dev/null +++ b/queries/dockerfile/highlights.scm @@ -0,0 +1,50 @@ +[ + "FROM" + "AS" + "RUN" + "CMD" + "LABEL" + "EXPOSE" + "ENV" + "ADD" + "COPY" + "ENTRYPOINT" + "VOLUME" + "USER" + "WORKDIR" + "ARG" + "ONBUILD" + "STOPSIGNAL" + "HEALTHCHECK" + "SHELL" + "MAINTAINER" + "CROSS_BUILD" +] @keyword + +[ + ":" + "@" +] @operator + +(comment) @comment + +(image_spec + (image_tag + ":" @punctuation.special) + (image_digest + "@" @punctuation.special)) + +(double_quoted_string) @string + +(expansion + [ + "$" + "{" + "}" + ] @punctuation.special +) + +((variable) @constant + (#match? @constant "^[A-Z][A-Z_0-9]*$")) + + diff --git a/queries/dockerfile/injections.scm b/queries/dockerfile/injections.scm new file mode 100644 index 00000000..c1fdd3f9 --- /dev/null +++ b/queries/dockerfile/injections.scm @@ -0,0 +1,3 @@ +(comment) @comment + +(shell_command) @bash -- cgit v1.2.3