|
# Nimcheck: Universal Syntax Validator
|
|
|
|
[](https://nim-lang.org)
|
|
[](LICENSE)
|
|
|
|
> **Fast, accurate syntax validation for 27+ languages.**
|
|
> Built in Nim. Zero dependencies beyond the standard library.
|
|
|
|
---
|
|
|
|
## Table of Contents
|
|
|
|
1. [Features](#features)
|
|
2. [Installation](#installation)
|
|
3. [Quick Start](#quick-start)
|
|
4. [Usage](#usage)
|
|
5. [Supported Languages](#supported-languages)
|
|
|
|
---
|
|
|
|
## 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
|
|
|
|
```bash
|
|
git clone https://github.com/retoor/nimcheck
|
|
cd nimcheck
|
|
make release
|
|
```
|
|
|
|
### Via Nimble
|
|
|
|
```bash
|
|
nimble install nimcheck
|
|
```
|
|
|
|
---
|
|
|
|
## Quick Start
|
|
|
|
```bash
|
|
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
|
|
|
|
```bash
|
|
nimcheck src/main.nim
|
|
```
|
|
|
|
### Validate with explicit language
|
|
|
|
```bash
|
|
nimcheck --flavor python script.py
|
|
```
|
|
|
|
### Recursive directory scan
|
|
|
|
```bash
|
|
nimcheck --recursive project/
|
|
```
|
|
|
|
### JSON output for CI
|
|
|
|
```bash
|
|
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](https://github.com/retoor)
|