Skip to content

feat: DevOps, k8s, Helm file types - #365

Open
shyamenk wants to merge 1 commit into
RivoLink:mainfrom
shyamenk:feat/devops-syntaxes
Open

shyamenk wants to merge 1 commit into
RivoLink:mainfrom
shyamenk:feat/devops-syntaxes

Conversation

@shyamenk

@shyamenk shyamenk commented Nov 10, 2026 •

Copy link
Copy Markdown

What changed

  • Replace syntect's default syntax set with the two-face bundle (the extra syntaxes bat ships). It uses the same syntect 5.2 / onig backend, so no new regex engine.
  • Add aliases for tf, tfvars, hcl, terraform, make/makefile, env/ini/conf, and groovy/jenkinsfile.
  • Add a syntax_key helper so extensionless files (Dockerfile, Dockerfile.*, Makefile, Jenkinsfile, .env) are highlighted when opened and are accepted by the file picker when their file name (e.g. Dockerfile) is listed in extras.
  • Kubernetes/Ansible/Helm: manifests, values.yaml and playbooks are YAML and were already covered. Added Jinja2 (j2), Helm templates (tpl, gotmpl, highlighted as Jinja2 since no Go-template grammar ships), Rego, Protocol Buffers, systemd units and Ansible inventory (as INI), nginx conf, and Tiltfile/Vagrantfile.
  • README: note the DevOps formats in the Extra Files section.

Why

Terraform/HCL, Dockerfile and Makefile files opened as plain Markdown with no highlighting (.tf also got its straight quotes converted to curly ones), because the default syntect set has no HCL grammar and Leaf only looked at file extensions.

How it was tested

  • cargo test: 983 passed, including new resolve_syntax_supports_devops_file_types and syntax_key_maps_extensionless_devops_files. The shared test syntax set now uses two-face too.
  • cargo clippy --all-targets --all-features -- -D warnings and cargo fmt --check: clean.
  • leaf --inline ansi on sample files, counting distinct colors before/after: main.tf 1 → 6, Dockerfile 1 → 4, Makefile 1 → 4, YAML unchanged.
  • Ran the real TUI in tmux: the browser picker (--picker) and fuzzy picker (--fuzzy) list Dockerfile/Makefile when named in extras, and leaf Dockerfile opens highlighted. New test file_picker_lists_extensionless_devops_files_from_extras.
  • Size and startup, both built from source with cargo build --release on the same machine (upstream main at 554dcea vs this branch):
    • Binary: 15,703,896 -> 16,345,840 bytes (+641,944, +4.1%).
    • Startup (leaf --inline plain README.md, 200 interleaved runs each): median 4.79 ms -> 6.58 ms (+1.79 ms), p95 5.21 ms -> 7.33 ms. The extra time is the larger syntax set being loaded at launch.

@shyamenk
shyamenk force-pushed the feat/devops-syntaxes branch 2 times, most recently from 1e5449e to 513fb95 Compare November 10, 2026 05:23
@shyamenk shyamenk changed the title feat: DevOps file syntax support feat: DevOps, k8s, Helm file types Nov 10, 2026
Switch to the two-face syntax bundle so Terraform/HCL, TOML, INI,
Groovy, Dockerfile, Makefile, Rego, Protocol Buffers and nginx files
get syntax highlighting. Add aliases for Jinja2 and Helm templates
(tpl, gotmpl), systemd units, Ansible inventory, Tiltfile and
Vagrantfile. Kubernetes manifests and Ansible playbooks are YAML.

Add a syntax_key helper so extensionless files (Dockerfile, Makefile,
Jenkinsfile, .env, ...) are recognized when opened, and let `extras`
match file names so they appear in the file pickers.
@shyamenk
shyamenk force-pushed the feat/devops-syntaxes branch from 513fb95 to 7f2339f Compare November 10, 2026 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant