From 40d0d45435ab857a3a524571587d9f6ba0c19df0 Mon Sep 17 00:00:00 2001 From: Johnson K C Date: Wed, 17 Jun 2026 11:50:39 -0400 Subject: [PATCH] docs(config): document extra_extensions values and skip behavior The README's "Custom File Extensions" section showed a single example key and stated that unknown language values are "silently skipped". Issue #359 asks what other config-file options exist and where they are documented. - Clarify that `extra_extensions` is the only key the JSON config files accept. - List the accepted, case-insensitive language names (and aliases) so users know which values are valid. - Document the "extension must start with ." rule. - Correct the behavior note: invalid entries are skipped with a warning logged to stderr (the parser calls cbm_log_warn), not silently. Closes #359 Signed-off-by: Johnson K C --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b48a297f..d4d066a5 100644 --- a/README.md +++ b/README.md @@ -453,7 +453,7 @@ export CBM_CACHE_DIR=~/my-projects/cbm-data ## Custom File Extensions -Map additional file extensions to supported languages via JSON config files. Useful for framework-specific extensions like `.blade.php` (Laravel) or `.mjs` (ES modules). +The JSON config files support a single key, `extra_extensions`, which maps additional file extensions to supported languages. Useful for framework-specific extensions like `.blade.php` (Laravel) or `.mjs` (ES modules). (For other tunables, see [Environment Variables](#environment-variables) and the `config` subcommand above.) **Per-project** (in your repo root): ```json @@ -467,7 +467,11 @@ Map additional file extensions to supported languages via JSON config files. Use {"extra_extensions": {".twig": "html", ".phtml": "php"}} ``` -Project config overrides global for conflicting extensions. Unknown language values are silently skipped. Missing config files are ignored. +Each entry maps an extension (which **must** start with `.`) to a language name. Language names are matched **case-insensitively**. Accepted values (aliases in parentheses) are: + +`bash` (`sh`), `c`, `c++` (`cpp`), `c#` (`csharp`), `clojure`, `cmake`, `cobol`, `common lisp` (`commonlisp`, `lisp`), `css`, `cuda`, `dart`, `dockerfile`, `elixir`, `elm`, `emacs lisp` (`emacslisp`), `erlang`, `f#` (`fsharp`), `form`, `fortran`, `glsl`, `go`, `graphql`, `groovy`, `haskell`, `hcl` (`terraform`), `html`, `ini`, `java`, `javascript`, `json`, `julia`, `kotlin`, `lean`, `lua`, `magma`, `makefile`, `markdown`, `matlab`, `meson`, `nix`, `objective-c` (`objc`), `ocaml`, `perl`, `php`, `protobuf`, `python`, `r`, `ruby`, `rust`, `scala`, `scss`, `sql`, `svelte`, `swift`, `toml`, `tsx`, `typescript`, `verilog`, `vimscript`, `vue`, `wolfram`, `xml`, `yaml`, `zig`. + +Project config overrides global for conflicting extensions. An entry whose language name is unknown, or whose extension does not start with `.`, is skipped and a warning is logged to stderr (shown at the default `info` log level). Missing config files are ignored. ## Persistence