chroma icon indicating copy to clipboard operation
chroma copied to clipboard

Docker lexer does not work properly for HEALTHCHECK statements

Open frapa opened this issue 1 year ago • 0 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Describe the bug

Chroma does not seem to properly highlight the HEALTHCHECK statement in dockerfiles

image

This is also demonstrated by the HTML which is not tokenized:

image

Test file to reproduce the issue

FROM golang as build

RUN apt-get install wget curl && \
    wget https://github.com/watchexec/watchexec/releases/download/v1.24.2/watchexec-1.24.2-x86_64-unknown-linux-gnu.deb && \
    dpkg -i watchexec-1.24.2-x86_64-unknown-linux-gnu.deb && \
    rm watchexec-1.24.2-x86_64-unknown-linux-gnu.deb

ENV REPOSITORY_ROOT="/repositories"
ENV TEMPLATE_DIR="/api/templates"
ENV STATIC_DIR="/api/static"


WORKDIR /api/src
RUN mkdir /.cache && chmod 0777 /.cache

HEALTHCHECK --interval=10s --timeout=10s --retries=3 CMD curl http://localhost:3333/sign-in

USER 1234:1234
ENTRYPOINT ["watchexec", "-r", "-w", "/api", "go", "run", "."]

The lexer contains the proper rule, I am not sure why it fails to match. Checking the regex on regex101 also suggest the regex is correct, so I am lost why my highlighting is off.

I am using chroma v2 on go 1.21.

To Reproduce

Here is also the Playground version, which seems a bit odd as well.

frapa avatar Feb 05 '24 20:02 frapa