Nimcheck: Universal Syntax Validator
Fast, accurate syntax validation for 27+ languages.
Built in Nim. Zero dependencies beyond the standard library.
Table of Contents
Features
- Multi-language — validates Nim, Python, JavaScript, TypeScript, PHP, Ruby, Rust, Go, Lua, C, C++, C#, Java, Swift, Kotlin, Bash, HTML, XML, Jinja, JSON, YAML, TOML, CSS, SQL, Markdown, Dockerfile, Makefile
- Blazing fast — compiles to native code via Nim
- Auto-detection — identifies language from extension, shebang, or content analysis
- CI-friendly — exit codes and structured output
Detection Methods
| Priority | Method | Confidence |
|---|---|---|
| 1 | Explicit | 100% |
| 2 | Extension | 90% |
| 3 | Shebang | 95% |
| 4 | Content | 70-95% |
Installation
From Source
git clone https://github.com/retoor/nimcheck
cd nimcheck
make release
Via Nimble
nimble install nimcheck
Quick Start
nimcheck src/ # validate all files in src/
nimcheck --flavor nim # validate as Nim
nimcheck --json # JSON output
nimcheck --watch # watch mode
Usage Examples
Validate a single file
nimcheck src/main.nim
Validate with explicit language
nimcheck --flavor python script.py
Recursive directory scan
nimcheck --recursive project/
JSON output for CI
nimcheck --json --recursive src/ > report.json
Supported Languages
| Language | Extensions |
|---|---|
| Nim | .nim, .nims, .nimble |
| Python | .py, .pyw, .pyx, .pxd |
| JavaScript | .js, .mjs, .cjs |
| TypeScript | .ts, .tsx |
| PHP | .php, .phtml |
| HTML | .html, .htm, .xhtml |
| XML | .xml, .svg |
| JSON | .json, .jsonc |
| YAML | .yaml, .yml |
| TOML | .toml |
| CSS | .css |
| SQL | .sql |
| Markdown | .md, .markdown |
| Ruby | .rb |
| Rust | .rs |
| Go | .go |
| Lua | .lua |
| C | .c, .h |
| C++ | .cpp, .cxx, .hpp |
| C# | .cs |
| Java | .java |
| Swift | .swift |
| Kotlin | .kt, .kts |
| Bash | .sh, .bash |
| Dockerfile | Dockerfile |
| Makefile | Makefile |
License
MIT © Retoor