tree-sitter-dockerfile
tree-sitter-dockerfile copied to clipboard
A tree-sitter grammar for Dockerfile
Hi, I'm seeing some incorrect highlighting for some of the `RUN` directives in this `Dockerfile` in Neovim; ```Dockerfile FROM node:20-alpine AS builder WORKDIR /staging COPY . /staging/ RUN corepack enable...
I checked that `echo "\e[91m"` is syntactically valid in both Bash and Bourne shell (although it has a different meaning, see my comment at https://github.com/semgrep/semgrep/issues/10068#issuecomment-2057821081). It causes a parsing error...
The following is supported by `docker` by the current tree-sitter-dockerfile implementation only supports unquoted strings: ``` FROM busybox USER "nobody:nobody" ```
The official documentation makes no mention of supporting multiple variables in a single ARG instruction (https://docs.docker.com/reference/dockerfile/#arg). However, the `docker` command supports multiple variables. For example, the following does what one...
Here's some input that causes the parsing error: ``` $ cat trailing-comment.dockerfile FROM busybox RUN ls \ # comment with nothing after ``` It is accepted by `docker` but not...
Without `heredoc_line` and `shell_fragment` being present in a tree it's much easier to add language injections, for example, with bash: ```scm ((shell_command) @injection.content (#set! injection.language "bash")) ((run_instruction (heredoc_block) @injection.content) (#set!...
This library is incompatible with the latest version of tree-sitter when used as a rust library, as the versions are incompatible.
Minimal reproducible example: ```dockerfiile ENV PYTHONUNBUFFERED=1 \ # don't write precompiled files: already applied, keeping here just in case PYTHONDONTWRITEBYTECODE=1 \ # a method to cleanly setup virtualenv VIRTUAL_ENV="/opt/venv" ```...
fixes #54