feat: add extended language validators and fix tokenizer crash bugs
Expand nimcheck with validators and tokenizers for C, C++, C#, Go, Rust, Ruby, CSS, SQL, Markdown, Dockerfile, Makefile, Kotlin, Lua, Swift, TypeScript, and XML. Register all flavors in the validator factory and improve auto-detection scoring for the new languages. Fix infinite tokenizer loops that caused OOM kills: closeBracket now advances position, finishTokenizeStep guards stalled tokenization, and Jinja/JS tokenizers no longer double-advance on brackets. Fix block-balance false positives in Lua (for/do) and Ruby (postfix unless), SQL trailing-comma detection across whitespace, and Makefile tab literals in test fixtures.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
FROM alpine:3.20 as builder
|
||||
RUN apk add --no-cache gcc musl-dev make
|
||||
WORKDIR /build
|
||||
COPY . .
|
||||
RUN make release
|
||||
FROM alpine:3.20
|
||||
RUN apk add --no-cache pcre openssl
|
||||
COPY --from=builder /build/bin/app /usr/local/bin/app
|
||||
ENTRYPOINT ["app"]
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
FROM alpine:3.20 AS builder
|
||||
RUN apk add --no-cache \
|
||||
gcc \
|
||||
musl-dev \
|
||||
make \
|
||||
|
||||
FROM alpine:3.20
|
||||
|
||||
COPY --from=builder /build/bin/app /usr/local/bin/app
|
||||
|
||||
ENTRYPOINT ["app"
|
||||
CMD ["--help"]
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
FROM alpine:3.20 AS builder
|
||||
|
||||
RUN apk add --no-cache \
|
||||
gcc \
|
||||
musl-dev \
|
||||
pcre-dev \
|
||||
openssl-dev \
|
||||
make \
|
||||
git
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN make release \
|
||||
&& strip bin/nimcheck
|
||||
|
||||
FROM alpine:3.20 AS runtime
|
||||
|
||||
RUN apk add --no-cache \
|
||||
pcre \
|
||||
openssl \
|
||||
ca-certificates \
|
||||
tzdata
|
||||
|
||||
ENV TZ=UTC
|
||||
ENV NIMCHECK_LOG_LEVEL=info
|
||||
ENV NIMCHECK_THREADS=4
|
||||
|
||||
RUN addgroup -g 1000 nimcheck \
|
||||
&& adduser -D -u 1000 -G nimcheck nimcheck
|
||||
|
||||
COPY --from=builder /build/bin/nimcheck /usr/local/bin/nimcheck
|
||||
|
||||
RUN chmod 755 /usr/local/bin/nimcheck
|
||||
|
||||
WORKDIR /workspace
|
||||
|
||||
USER nimcheck
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=3s --retries=3 \
|
||||
CMD nimcheck --version || exit 1
|
||||
|
||||
ENTRYPOINT ["nimcheck"]
|
||||
CMD ["--help"]
|
||||
Reference in New Issue
Block a user