Skip to content

Commit 40d0d45

Browse files
committed
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 <Johnsonkc201@gmail.com>
1 parent e599df1 commit 40d0d45

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ export CBM_CACHE_DIR=~/my-projects/cbm-data
453453

454454
## Custom File Extensions
455455

456-
Map additional file extensions to supported languages via JSON config files. Useful for framework-specific extensions like `.blade.php` (Laravel) or `.mjs` (ES modules).
456+
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.)
457457

458458
**Per-project** (in your repo root):
459459
```json
@@ -467,7 +467,11 @@ Map additional file extensions to supported languages via JSON config files. Use
467467
{"extra_extensions": {".twig": "html", ".phtml": "php"}}
468468
```
469469

470-
Project config overrides global for conflicting extensions. Unknown language values are silently skipped. Missing config files are ignored.
470+
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:
471+
472+
`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`.
473+
474+
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.
471475

472476
## Persistence
473477

0 commit comments

Comments
 (0)