mirror of https://github.com/grafana/loki
fix(deps): update module github.com/alecthomas/chroma/v2 to v2.20.0 (main) (#18710)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>pull/17454/head^2
parent
f39fc1e6e6
commit
c8e87ddfe5
@ -0,0 +1,65 @@ |
||||
# Multi-stage Dockerfile for chromad Go application using Hermit-managed tools |
||||
|
||||
# Build stage |
||||
FROM ubuntu:24.04 AS builder |
||||
|
||||
# Install system dependencies |
||||
RUN apt-get update && apt-get install -y \ |
||||
curl \ |
||||
git \ |
||||
make \ |
||||
ca-certificates \ |
||||
&& rm -rf /var/lib/apt/lists/* |
||||
|
||||
# Set working directory |
||||
WORKDIR /app |
||||
|
||||
# Copy the entire project (including bin directory with Hermit tools) |
||||
COPY . . |
||||
|
||||
# Make Hermit tools executable and add to PATH |
||||
ENV PATH="/app/bin:${PATH}" |
||||
|
||||
# Set Go environment variables for static compilation |
||||
ENV CGO_ENABLED=0 |
||||
ENV GOOS=linux |
||||
ENV GOARCH=amd64 |
||||
|
||||
# Build the application using make |
||||
RUN make build/chromad |
||||
|
||||
# Runtime stage |
||||
FROM alpine:3.22 AS runtime |
||||
|
||||
# Install ca-certificates for HTTPS requests |
||||
RUN apk --no-cache add ca-certificates curl |
||||
|
||||
# Create a non-root user |
||||
RUN addgroup -g 1001 chromad && \ |
||||
adduser -D -s /bin/sh -u 1001 -G chromad chromad |
||||
|
||||
# Set working directory |
||||
WORKDIR /app |
||||
|
||||
# Copy the binary from build stage |
||||
COPY --from=builder /app/build/chromad /app/chromad |
||||
|
||||
# Change ownership to non-root user |
||||
RUN chown chromad:chromad /app/chromad |
||||
|
||||
# Switch to non-root user |
||||
USER chromad |
||||
|
||||
# Expose port (default is 8080, but can be overridden via PORT env var) |
||||
EXPOSE 8080 |
||||
|
||||
# Set default environment variables |
||||
ENV PORT=8080 |
||||
ENV CHROMA_CSRF_KEY="testtest" |
||||
|
||||
# Health check |
||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ |
||||
CMD curl -fsSL http://127.0.0.1:8080/ > /dev/null |
||||
|
||||
# Run the application |
||||
CMD ["sh", "-c", "./chromad --csrf-key=$CHROMA_CSRF_KEY --bind=0.0.0.0:$PORT"] |
||||
@ -0,0 +1,6 @@ |
||||
{ |
||||
"$schema": "https://biomejs.dev/schemas/2.0.5/schema.json", |
||||
"formatter": { |
||||
"indentStyle": "space" |
||||
} |
||||
} |
||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,83 @@ |
||||
<lexer> |
||||
<config> |
||||
<name>lox</name> |
||||
<filename>*.lox</filename> |
||||
<dot_all>true</dot_all> |
||||
<ensure_nl>true</ensure_nl> |
||||
</config> |
||||
<rules> |
||||
<state name="classname"> |
||||
<rule pattern="[a-zA-Z_]\w*"> |
||||
<token type="NameClass"/> |
||||
<pop depth="1"/> |
||||
</rule> |
||||
</state> |
||||
<state name="funname"> |
||||
<rule pattern="[a-zA-Z_]\w*"> |
||||
<token type="NameFunction"/> |
||||
<pop depth="1"/> |
||||
</rule> |
||||
</state> |
||||
<state name="varname"> |
||||
<rule pattern="[a-zA-Z_]\w*"> |
||||
<token type="NameVariable"/> |
||||
<pop depth="1"/> |
||||
</rule> |
||||
</state> |
||||
<state name="whitespace"> |
||||
<rule pattern="\n"> |
||||
<token type="Text"/> |
||||
</rule> |
||||
<rule pattern="\s+"> |
||||
<token type="Text"/> |
||||
</rule> |
||||
</state> |
||||
<state name="root"> |
||||
<rule> |
||||
<include state="whitespace"/> |
||||
</rule> |
||||
<rule pattern="//.*?\n"> |
||||
<token type="CommentSingle"/> |
||||
</rule> |
||||
<rule pattern="(and|else|for|if|or|print|return|super|this|while)\b"> |
||||
<token type="Keyword"/> |
||||
</rule> |
||||
<rule pattern="(false|nil|true)\b"> |
||||
<token type="KeywordConstant"/> |
||||
</rule> |
||||
<rule pattern="(class)(\s*)"> |
||||
<token type="KeywordDeclaration"/> |
||||
<push state="classname"/> |
||||
</rule> |
||||
<rule pattern="(fun)(\s*)"> |
||||
<token type="KeywordDeclaration"/> |
||||
<push state="funname"/> |
||||
</rule> |
||||
<rule pattern="(var)(\s*)"> |
||||
<token type="KeywordDeclaration"/> |
||||
<push state="varname"/> |
||||
</rule> |
||||
<rule pattern="\d+(\.\d*|[eE][+\-]?\d+)"> |
||||
<token type="LiteralNumberFloat"/> |
||||
</rule> |
||||
<rule pattern="[0-9][0-9]*"> |
||||
<token type="LiteralNumberInteger"/> |
||||
</rule> |
||||
<rule pattern=""(\\\\|\\"|[^"])*""> |
||||
<token type="LiteralStringDouble"/> |
||||
</rule> |
||||
<rule pattern="!|\+|-|\*|/|<|>|="> |
||||
<token type="Operator"/> |
||||
</rule> |
||||
<rule pattern="[{(;,]"> |
||||
<token type="Punctuation"/> |
||||
</rule> |
||||
<rule pattern="[}).]"> |
||||
<token type="Punctuation"/> |
||||
</rule> |
||||
<rule pattern="[a-zA-Z_]\w*"> |
||||
<token type="NameVariable"/> |
||||
</rule> |
||||
</state> |
||||
</rules> |
||||
</lexer> |
||||
@ -0,0 +1,121 @@ |
||||
<lexer> |
||||
<config> |
||||
<name>Nu</name> |
||||
<alias>nu</alias> |
||||
<filename>*.nu</filename> |
||||
<mime_type>text/plain</mime_type> |
||||
</config> |
||||
<rules> |
||||
<state name="root"> |
||||
<rule><include state="basic" /></rule> |
||||
<rule><include state="data" /></rule> |
||||
</state> |
||||
<state name="basic"> |
||||
<rule |
||||
pattern="\b(alias|all|ansi|ansi gradient|ansi link|ansi strip|any|append|ast|attr category|attr deprecated|attr example|attr search-terms|banner|bits|bits and|bits not|bits or|bits rol|bits ror|bits shl|bits shr|bits xor|break|bytes|bytes add|bytes at|bytes build|bytes collect|bytes ends-with|bytes index-of|bytes length|bytes remove|bytes replace|bytes reverse|bytes split|bytes starts-with|cal|cd|char|chunk-by|chunks|clear|collect|columns|commandline|commandline edit|commandline get-cursor|commandline set-cursor|compact|complete|config|config env|config flatten|config nu|config reset|config use-colors|const|continue|cp|date|date format|date from-human|date humanize|date list-timezone|date now|date to-timezone|debug|debug env|debug info|debug profile|decode|decode base32|decode base32hex|decode base64|decode hex|def|default|describe|detect columns|do|drop|drop column|drop nth|du|each|each while|echo|encode|encode base32|encode base32hex|encode base64|encode hex|enumerate|error make|every|exec|exit|explain|explore|export|export alias|export const|export def|export extern|export module|export use|export-env|extern|fill|filter|find|first|flatten|for|format|format bits|format date|format duration|format filesize|format number|format pattern|from|from csv|from json|from msgpack|from msgpackz|from nuon|from ods|from ssv|from toml|from tsv|from url|from xlsx|from xml|from yaml|from yml|generate|get|glob|grid|group-by|hash|hash md5|hash sha256|headers|help|help aliases|help commands|help escapes|help externs|help modules|help operators|help pipe-and-redirect|hide|hide-env|histogram|history|history import|history session|http|http delete|http get|http head|http options|http patch|http post|http put|if|ignore|input|input list|input listen|insert|inspect|interleave|into|into binary|into bool|into cell-path|into datetime|into duration|into filesize|into float|into glob|into int|into record|into sqlite|into string|into value|is-admin|is-empty|is-not-empty|is-terminal|items|job|job flush|job id|job kill|job list|job recv|job send|job spawn|job tag|job unfreeze|join|keybindings|keybindings default|keybindings list|keybindings listen|kill|last|length|let|let-env|lines|load-env|loop|ls|match|math|math abs|math arccos|math arccosh|math arcsin|math arcsinh|math arctan|math arctanh|math avg|math ceil|math cos|math cosh|math exp|math floor|math ln|math log|math max|math median|math min|math mode|math product|math round|math sin|math sinh|math sqrt|math stddev|math sum|math tan|math tanh|math variance|merge|merge deep|metadata|metadata access|metadata set|mkdir|mktemp|module|move|mut|mv|nu-check|nu-highlight|open|overlay|overlay hide|overlay list|overlay new|overlay use|panic|par-each|parse|path|path basename|path dirname|path exists|path expand|path join|path parse|path relative-to|path self|path split|path type|plugin|plugin add|plugin list|plugin rm|plugin stop|plugin use|port|prepend|print|ps|pwd|query db|random|random binary|random bool|random chars|random dice|random float|random int|random uuid|reduce|reject|rename|return|reverse|rm|roll|roll down|roll left|roll right|roll up|rotate|run-external|save|schema|scope|scope aliases|scope commands|scope engine-stats|scope externs|scope modules|scope variables|select|seq|seq char|seq date|shuffle|skip|skip until|skip while|sleep|slice|sort|sort-by|source|source-env|split|split cell-path|split chars|split column|split list|split row|split words|start|stor|stor create|stor delete|stor export|stor import|stor insert|stor open|stor reset|stor update|str|str camel-case|str capitalize|str contains|str distance|str downcase|str ends-with|str expand|str index-of|str join|str kebab-case|str length|str pascal-case|str replace|str reverse|str screaming-snake-case|str snake-case|str starts-with|str stats|str substring|str title-case|str trim|str upcase|sys|sys cpu|sys disks|sys host|sys mem|sys net|sys temp|sys users|table|take|take until|take while|tee|term|term query|term size|timeit|to|to csv|to html|to json|to md|to msgpack|to msgpackz|to nuon|to text|to toml|to tsv|to xml|to yaml|to yml|touch|transpose|try|tutor|ulimit|uname|uniq|uniq-by|update|update cells|upsert|url|url build-query|url decode|url encode|url join|url parse|url split-query|use|values|version|version check|view|view blocks|view files|view ir|view source|view span|watch|where|which|while|whoami|window|with-env|wrap|zip)(\s*)\b" |
||||
><bygroups><token type="Keyword" /><token |
||||
type="TextWhitespace" |
||||
/></bygroups></rule> |
||||
<rule pattern="\A#!.+\n"><token type="CommentHashbang" /></rule> |
||||
<rule pattern="#.*\n"><token type="CommentSingle" /></rule> |
||||
<rule pattern="\\[\w\W]"><token type="LiteralStringEscape" /></rule> |
||||
<rule pattern="(\b\w+)(\s*)(\+?=)"><bygroups><token |
||||
type="NameVariable" |
||||
/><token type="TextWhitespace" /><token |
||||
type="Operator" |
||||
/></bygroups></rule> |
||||
<rule pattern="[\[\]{}()=]"><token type="Operator" /></rule> |
||||
<rule pattern="<<<"><token type="Operator" /></rule> |
||||
<rule pattern="<<-?\s*(\'?)\\?(\w+)[\w\W]+?\2"><token |
||||
type="LiteralString" |
||||
/></rule> |
||||
<rule pattern="&&|\|\|"><token type="Operator" /></rule> |
||||
<rule pattern="\$[a-zA-Z_]\w*"><token type="NameVariable" /></rule> |
||||
</state> |
||||
<state name="data"> |
||||
<rule pattern="\$""><token type="LiteralStringDouble" /><push |
||||
state="interpolated_string" |
||||
/></rule> |
||||
<rule pattern="(?s)"(\\.|[^"\\])*""><token |
||||
type="LiteralStringDouble" |
||||
/></rule> |
||||
<rule pattern="""><token type="LiteralStringDouble" /><push |
||||
state="string" |
||||
/></rule> |
||||
<rule pattern="(?s)\$'(\\\\|\\[0-7]+|\\.|[^'\\])*'"><token |
||||
type="LiteralStringSingle" |
||||
/></rule> |
||||
<rule pattern="(?s)'.*?'"><token |
||||
type="LiteralStringSingle" |
||||
/></rule> |
||||
<rule pattern=";"><token type="Punctuation" /></rule> |
||||
<rule pattern="&"><token type="Punctuation" /></rule> |
||||
<rule pattern="\|"><token type="Punctuation" /></rule> |
||||
<rule pattern="\s+"><token type="TextWhitespace" /></rule> |
||||
<rule pattern="\d+\b"><token type="LiteralNumber" /></rule> |
||||
<rule pattern="[^=\s\[\]{}()$"\'`\\<&|;]+"><token |
||||
type="Text" |
||||
/></rule> |
||||
<rule pattern="<"><token type="Text" /></rule> |
||||
</state> |
||||
<state name="string"> |
||||
<rule pattern="""><token type="LiteralStringDouble" /><pop |
||||
depth="1" |
||||
/></rule> |
||||
<rule pattern="(?s)(\\\\|\\[0-7]+|\\.|[^"\\$])+"><token |
||||
type="LiteralStringDouble" |
||||
/></rule> |
||||
</state> |
||||
<state name="interpolated_string"> |
||||
<rule pattern="""><token type="LiteralStringDouble" /><pop |
||||
depth="1" |
||||
/></rule> |
||||
<rule pattern="\("><token type="LiteralStringInterpol" /><push |
||||
state="interpolation" |
||||
/></rule> |
||||
<rule pattern="(?s)(\\\\|\\[0-7]+|\\.|[^"\\(])+"><token |
||||
type="LiteralStringDouble" |
||||
/></rule> |
||||
</state> |
||||
<state name="interpolation"> |
||||
<rule pattern="\)"><token type="LiteralStringInterpol" /><pop |
||||
depth="1" |
||||
/></rule> |
||||
<rule><include state="root" /></rule> |
||||
</state> |
||||
<state name="curly"> |
||||
<rule pattern="\}"><token type="LiteralStringInterpol" /><pop |
||||
depth="1" |
||||
/></rule> |
||||
<rule pattern=":-"><token type="Keyword" /></rule> |
||||
<rule pattern="\w+"><token type="NameVariable" /></rule> |
||||
<rule pattern="[^}:"\'`$\\]+"><token |
||||
type="Punctuation" |
||||
/></rule> |
||||
<rule pattern=":"><token type="Punctuation" /></rule> |
||||
<rule><include state="root" /></rule> |
||||
</state> |
||||
<state name="paren"> |
||||
<rule pattern="\)"><token type="Keyword" /><pop depth="1" /></rule> |
||||
<rule><include state="root" /></rule> |
||||
</state> |
||||
<state name="math"> |
||||
<rule pattern="\)\)"><token type="Keyword" /><pop depth="1" /></rule> |
||||
<rule pattern="\*\*|\|\||<<|>>|[-+*/%^|&<>]"><token |
||||
type="Operator" |
||||
/></rule> |
||||
<rule pattern="\d+#[\da-zA-Z]+"><token type="LiteralNumber" /></rule> |
||||
<rule pattern="\d+#(?! )"><token type="LiteralNumber" /></rule> |
||||
<rule pattern="0[xX][\da-fA-F]+"><token type="LiteralNumber" /></rule> |
||||
<rule pattern="\d+"><token type="LiteralNumber" /></rule> |
||||
<rule pattern="[a-zA-Z_]\w*"><token type="NameVariable" /></rule> |
||||
<rule><include state="root" /></rule> |
||||
</state> |
||||
<state name="backticks"> |
||||
<rule pattern="`"><token type="LiteralStringBacktick" /><pop |
||||
depth="1" |
||||
/></rule> |
||||
<rule><include state="root" /></rule> |
||||
</state> |
||||
</rules> |
||||
</lexer> |
||||
@ -0,0 +1,37 @@ |
||||
package lexers |
||||
|
||||
import ( |
||||
. "github.com/alecthomas/chroma/v2" // nolint
|
||||
) |
||||
|
||||
// Gemtext lexer.
|
||||
var Gemtext = Register(MustNewLexer( |
||||
&Config{ |
||||
Name: "Gemtext", |
||||
Aliases: []string{"gemtext", "gmi", "gmni", "gemini"}, |
||||
Filenames: []string{"*.gmi", "*.gmni", "*.gemini"}, |
||||
MimeTypes: []string{"text/gemini"}, |
||||
}, |
||||
gemtextRules, |
||||
)) |
||||
|
||||
func gemtextRules() Rules { |
||||
return Rules{ |
||||
"root": { |
||||
{`^(#[^#].+\r?\n)`, ByGroups(GenericHeading), nil}, |
||||
{`^(#{2,3}.+\r?\n)`, ByGroups(GenericSubheading), nil}, |
||||
{`^(\* )(.+\r?\n)`, ByGroups(Keyword, Text), nil}, |
||||
{`^(>)(.+\r?\n)`, ByGroups(Keyword, GenericEmph), nil}, |
||||
{"^(```\\r?\\n)([\\w\\W]*?)(^```)(.+\\r?\\n)?", ByGroups(String, Text, String, Comment), nil}, |
||||
{ |
||||
"^(```)(\\w+)(\\r?\\n)([\\w\\W]*?)(^```)(.+\\r?\\n)?", |
||||
UsingByGroup(2, 4, String, String, String, Text, String, Comment), |
||||
nil, |
||||
}, |
||||
{"^(```)(.+\\r?\\n)([\\w\\W]*?)(^```)(.+\\r?\\n)?", ByGroups(String, String, Text, String, Comment), nil}, |
||||
{`^(=>)(\s*)([^\s]+)(\s*)$`, ByGroups(Keyword, Text, NameAttribute, Text), nil}, |
||||
{`^(=>)(\s*)([^\s]+)(\s+)(.+)$`, ByGroups(Keyword, Text, NameAttribute, Text, NameTag), nil}, |
||||
{`(.|(?:\r?\n))`, ByGroups(Text), nil}, |
||||
}, |
||||
} |
||||
} |
||||
Loading…
Reference in new issue