Skip to content

Teach Checkrun merge-hook fragment filetypes#30

Merged
cgraf78 merged 3 commits into
mainfrom
editor-merge-hook-filetypes
Jul 7, 2026
Merged

Teach Checkrun merge-hook fragment filetypes#30
cgraf78 merged 3 commits into
mainfrom
editor-merge-hook-filetypes

Conversation

@cgraf78

@cgraf78 cgraf78 commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Summary

Add Checkrun registry coverage for dot merge-hook fragment suffixes and common editor filetype associations so Checkrun, Neovim, VS Code projection, and other repositories share one durable language vocabulary.

This maps:

  • *.ssh_config and legacy *.ssh-config to the ssh_config VS Code language
  • Sapling hgrc-style fragments to ini instead of Git config, avoiding false lint failures on valid hgrc hook keys
  • path/text fragments, TSV data fragments, and legacy agent-rule target .conf paths to plaintext
  • common editor config names such as .env, .clang-format, .gitignore, .npmrc, .flake8, settings.json, tasks.json, devcontainer.json, Pipfile, and VS Code workspace/profile/theme configuration names
  • common editor suffixes such as *.jsonl, alternate Markdown extensions, *.dockerfile, *.containerfile, *.properties, and common ignore/properties-style config suffixes

The registry intentionally avoids broad or risky mappings: generic .conf remains unmapped, generated lockfiles are not routed through normal format selectors, and .code-snippets is left to its native VS Code snippets language.

This also updates Checkrun filetype inference so exact filenames win first, narrow glob patterns can override generic extensions, and generic extensions remain the fallback. That makes patterns such as *color-theme.json and *language-configuration.json resolve as JSONC instead of being shadowed by .json.

Testing

  • checkrun format share/checkrun/registry.json test/suites/capabilities-test test/suites/nvim-test test/suites/registry-test
  • checkrun lint share/checkrun/registry.json test/suites/capabilities-test test/suites/nvim-test test/suites/registry-test
  • checkrun lint share/checkrun/registry.json test/suites/capabilities-test test/suites/registry-test test/suites/nvim-test lib/checkrun/registry.py
  • test/suites/capabilities-test
  • test/suites/registry-test
  • test/suites/nvim-test
  • registry ordering check for extension, filename, and pattern mappings
  • test/checkrun-test
  • fresh-eyes subagent review

cgraf78 added 3 commits July 7, 2026 07:40
Summary

Add registry coverage for dot merge-hook fragment suffixes so Checkrun can
project stable editor language associations for VS Code and Neovim.

- map SSH fragments to the VS Code `ssh_config` language via the shared
  `sshconfig` filetype
- map hgrc-style Sapling fragments to `ini`, avoiding false Git config lint
  failures while still giving editors syntax highlighting
- map text fragment suffixes and legacy agent-rule target `.conf` paths to
  plaintext
- cover preferred and legacy suffixes in capabilities, registry, and Neovim
  adapter tests

Testing

- `checkrun format share/checkrun/registry.json test/suites/capabilities-test test/suites/nvim-test test/suites/registry-test`
- `checkrun lint share/checkrun/registry.json test/suites/capabilities-test test/suites/nvim-test test/suites/registry-test`
- `test/suites/capabilities-test && test/suites/registry-test && test/suites/nvim-test`
- `test/checkrun-test`
Summary

Teach Checkrun to treat tab-separated fragment files as text so generated
editor settings classify dot merge-hook TSV sources without renaming them away
from their common data-file suffix.

- map `*.tsv` to Checkrun's text filetype and VS Code plaintext projection
- cover the capability surface and registry planning for representative TSV
  fragments

Testing

- `test/suites/capabilities-test && test/suites/registry-test`
- `checkrun lint share/checkrun/registry.json test/suites/capabilities-test test/suites/registry-test`
- `test/checkrun-test`
Summary

Expand the registry with conservative editor filetype associations from VS Code and common built-in editor conventions so Checkrun, Neovim, and downstream editor projection share the same vocabulary.

Keep broad or risky associations out of the registry: generated lockfiles are not treated as normal format targets, snippets are not forced away from their native language, and generic conf files are left alone so existing path-scoped merge-hook compatibility remains intact.

Update registry inference so exact filenames win first, narrow glob associations can override generic suffixes, and generic extensions remain the fallback. This makes json theme/config suffix associations effective instead of relying on json and jsonc currently selecting the same tools.

Testing

- test/suites/capabilities-test
- test/suites/registry-test
- test/suites/nvim-test
- checkrun lint share/checkrun/registry.json test/suites/capabilities-test test/suites/registry-test test/suites/nvim-test lib/checkrun/registry.py
- registry ordering check for extension, filename, and pattern mappings
- test/checkrun-test
- fresh-eyes subagent review
@cgraf78 cgraf78 merged commit 0aaa2ba into main Jul 7, 2026
6 checks passed
@cgraf78 cgraf78 deleted the editor-merge-hook-filetypes branch July 7, 2026 18:15
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