2026-07-08 10:01:58 +02:00
|
|
|
# Nimcheck
|
feat: add initial validatrix project with multi-language validator framework
Establish the Validatrix source code validation framework in Nim, including core detection, tokenization, and validation infrastructure for 10 languages (bash, HTML, JavaScript, Jinja, JSON, Nim, PHP, Python, TOML, YAML). The initial commit introduces the main validatrix.nim entry point with public API (validateSource, validateFile, inspectSource), a comprehensive test suite with per-language test files, build configuration via Makefile and .nimble, detailed LESSONS_LEARNED.md documenting 14 bug classes found during development, and a .gitignore excluding compiled binaries, logs, and build artifacts. The detector module provides extension-to-flavor mapping for 40+ file extensions and content-based language detection, while the debug module supports conditional compilation with -d:validatrixDebug for detailed tokenization logging.
2026-07-08 06:25:59 +02:00
|
|
|
|
2026-07-15 06:59:03 +02:00
|
|
|
Universal source code validation framework for Nim. Tokenizer-based structural
|
|
|
|
|
analysis across 28 language flavors, with extension, shebang, and content
|
|
|
|
|
auto-detection, structured JSON diagnostics, and exception-safe validation
|
|
|
|
|
paths.
|
2026-07-15 06:54:12 +02:00
|
|
|
|
2026-07-15 06:59:03 +02:00
|
|
|
Author: retoor <retoor@molodetz.nl> · Version 0.1.0 · License MIT · Nim >= 2.0.0
|
feat: add initial validatrix project with multi-language validator framework
Establish the Validatrix source code validation framework in Nim, including core detection, tokenization, and validation infrastructure for 10 languages (bash, HTML, JavaScript, Jinja, JSON, Nim, PHP, Python, TOML, YAML). The initial commit introduces the main validatrix.nim entry point with public API (validateSource, validateFile, inspectSource), a comprehensive test suite with per-language test files, build configuration via Makefile and .nimble, detailed LESSONS_LEARNED.md documenting 14 bug classes found during development, and a .gitignore excluding compiled binaries, logs, and build artifacts. The detector module provides extension-to-flavor mapping for 40+ file extensions and content-based language detection, while the debug module supports conditional compilation with -d:validatrixDebug for detailed tokenization logging.
2026-07-08 06:25:59 +02:00
|
|
|
|
2026-07-15 06:59:03 +02:00
|
|
|
## Capabilities
|
feat: add initial validatrix project with multi-language validator framework
Establish the Validatrix source code validation framework in Nim, including core detection, tokenization, and validation infrastructure for 10 languages (bash, HTML, JavaScript, Jinja, JSON, Nim, PHP, Python, TOML, YAML). The initial commit introduces the main validatrix.nim entry point with public API (validateSource, validateFile, inspectSource), a comprehensive test suite with per-language test files, build configuration via Makefile and .nimble, detailed LESSONS_LEARNED.md documenting 14 bug classes found during development, and a .gitignore excluding compiled binaries, logs, and build artifacts. The detector module provides extension-to-flavor mapping for 40+ file extensions and content-based language detection, while the debug module supports conditional compilation with -d:validatrixDebug for detailed tokenization logging.
2026-07-08 06:25:59 +02:00
|
|
|
|
2026-07-15 06:59:03 +02:00
|
|
|
- Detector — resolves `LanguageFlavor` from explicit input, file extension,
|
|
|
|
|
shebang, or content scoring with false-positive filters.
|
|
|
|
|
- Tokenizer — per-language lexers; position tracking, bracket stack, string and
|
|
|
|
|
comment context.
|
|
|
|
|
- Validator — structural analysis per flavor; factory registry with 40+ aliases.
|
|
|
|
|
- Reporting — `formatReport()` and `toJson()` on all result types.
|
|
|
|
|
- CLI — `validate`, `inspect`, and `detect` subcommands.
|
|
|
|
|
- Library — `import nimcheck` for `validateSource`, `validateFile`, `inspectSource`.
|
feat: add initial validatrix project with multi-language validator framework
Establish the Validatrix source code validation framework in Nim, including core detection, tokenization, and validation infrastructure for 10 languages (bash, HTML, JavaScript, Jinja, JSON, Nim, PHP, Python, TOML, YAML). The initial commit introduces the main validatrix.nim entry point with public API (validateSource, validateFile, inspectSource), a comprehensive test suite with per-language test files, build configuration via Makefile and .nimble, detailed LESSONS_LEARNED.md documenting 14 bug classes found during development, and a .gitignore excluding compiled binaries, logs, and build artifacts. The detector module provides extension-to-flavor mapping for 40+ file extensions and content-based language detection, while the debug module supports conditional compilation with -d:validatrixDebug for detailed tokenization logging.
2026-07-08 06:25:59 +02:00
|
|
|
|
2026-07-15 06:59:03 +02:00
|
|
|
Flavors with validators: Nim, Python, Bash, JavaScript, TypeScript, PHP, HTML,
|
|
|
|
|
XML, Jinja, JSON, YAML, TOML, C, C++, C#, Java, Go, Rust, Ruby, Lua, Swift,
|
|
|
|
|
Kotlin, CSS, SQL, Markdown, Dockerfile, Makefile. See `supportedFlavors()` or
|
|
|
|
|
`bin/nimcheck help` for registered aliases.
|
feat: add initial validatrix project with multi-language validator framework
Establish the Validatrix source code validation framework in Nim, including core detection, tokenization, and validation infrastructure for 10 languages (bash, HTML, JavaScript, Jinja, JSON, Nim, PHP, Python, TOML, YAML). The initial commit introduces the main validatrix.nim entry point with public API (validateSource, validateFile, inspectSource), a comprehensive test suite with per-language test files, build configuration via Makefile and .nimble, detailed LESSONS_LEARNED.md documenting 14 bug classes found during development, and a .gitignore excluding compiled binaries, logs, and build artifacts. The detector module provides extension-to-flavor mapping for 40+ file extensions and content-based language detection, while the debug module supports conditional compilation with -d:validatrixDebug for detailed tokenization logging.
2026-07-08 06:25:59 +02:00
|
|
|
|
2026-07-08 10:19:01 +02:00
|
|
|
## Architecture
|
feat: add initial validatrix project with multi-language validator framework
Establish the Validatrix source code validation framework in Nim, including core detection, tokenization, and validation infrastructure for 10 languages (bash, HTML, JavaScript, Jinja, JSON, Nim, PHP, Python, TOML, YAML). The initial commit introduces the main validatrix.nim entry point with public API (validateSource, validateFile, inspectSource), a comprehensive test suite with per-language test files, build configuration via Makefile and .nimble, detailed LESSONS_LEARNED.md documenting 14 bug classes found during development, and a .gitignore excluding compiled binaries, logs, and build artifacts. The detector module provides extension-to-flavor mapping for 40+ file extensions and content-based language detection, while the debug module supports conditional compilation with -d:validatrixDebug for detailed tokenization logging.
2026-07-08 06:25:59 +02:00
|
|
|
|
2026-07-08 10:19:01 +02:00
|
|
|
```
|
2026-07-15 06:59:03 +02:00
|
|
|
Source → Detector → Tokenizer → Validator → Reporting → ValidationResult
|
2026-07-08 10:19:01 +02:00
|
|
|
```
|
feat: add initial validatrix project with multi-language validator framework
Establish the Validatrix source code validation framework in Nim, including core detection, tokenization, and validation infrastructure for 10 languages (bash, HTML, JavaScript, Jinja, JSON, Nim, PHP, Python, TOML, YAML). The initial commit introduces the main validatrix.nim entry point with public API (validateSource, validateFile, inspectSource), a comprehensive test suite with per-language test files, build configuration via Makefile and .nimble, detailed LESSONS_LEARNED.md documenting 14 bug classes found during development, and a .gitignore excluding compiled binaries, logs, and build artifacts. The detector module provides extension-to-flavor mapping for 40+ file extensions and content-based language detection, while the debug module supports conditional compilation with -d:validatrixDebug for detailed tokenization logging.
2026-07-08 06:25:59 +02:00
|
|
|
|
2026-07-15 06:59:03 +02:00
|
|
|
Layer detail: [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md).
|
2026-07-08 06:29:19 +02:00
|
|
|
|
2026-07-15 06:59:03 +02:00
|
|
|
## Quick start
|
2026-07-08 06:29:19 +02:00
|
|
|
|
2026-07-15 06:59:03 +02:00
|
|
|
### Library
|
2026-07-08 06:29:19 +02:00
|
|
|
|
2026-07-08 10:19:01 +02:00
|
|
|
```nim
|
|
|
|
|
import nimcheck
|
2026-07-08 06:29:19 +02:00
|
|
|
|
2026-07-08 10:19:01 +02:00
|
|
|
let r = validateSource("proc hello() = echo 'hi'", lfNim)
|
2026-07-15 06:59:03 +02:00
|
|
|
echo r.valid
|
|
|
|
|
echo r.toJson().pretty()
|
2026-07-08 06:29:19 +02:00
|
|
|
|
2026-07-08 10:19:01 +02:00
|
|
|
let r2 = validateFile("src/main.nim")
|
|
|
|
|
let info = inspectSource("class Foo:\n def bar(self): pass", lfPython)
|
|
|
|
|
```
|
2026-07-08 06:29:19 +02:00
|
|
|
|
2026-07-15 06:59:03 +02:00
|
|
|
### CLI
|
2026-07-08 06:29:19 +02:00
|
|
|
|
|
|
|
|
```bash
|
2026-07-08 10:19:01 +02:00
|
|
|
make build
|
2026-07-08 10:01:58 +02:00
|
|
|
bin/nimcheck validate --file=source.nim
|
|
|
|
|
bin/nimcheck validate --source="print('hi')" --flavor=python
|
|
|
|
|
bin/nimcheck inspect --file=source.py
|
|
|
|
|
bin/nimcheck detect --file=unknown.txt
|
2026-07-15 06:59:03 +02:00
|
|
|
echo "var x = 1" | bin/nimcheck validate
|
2026-07-08 10:19:01 +02:00
|
|
|
```
|
|
|
|
|
|
2026-07-15 06:59:03 +02:00
|
|
|
CLI reference: [docs/API.md](docs/API.md) (or `bin/nimcheck help`).
|
2026-07-08 10:19:01 +02:00
|
|
|
|
2026-07-15 06:59:03 +02:00
|
|
|
## Requirements
|
feat: add initial validatrix project with multi-language validator framework
Establish the Validatrix source code validation framework in Nim, including core detection, tokenization, and validation infrastructure for 10 languages (bash, HTML, JavaScript, Jinja, JSON, Nim, PHP, Python, TOML, YAML). The initial commit introduces the main validatrix.nim entry point with public API (validateSource, validateFile, inspectSource), a comprehensive test suite with per-language test files, build configuration via Makefile and .nimble, detailed LESSONS_LEARNED.md documenting 14 bug classes found during development, and a .gitignore excluding compiled binaries, logs, and build artifacts. The detector module provides extension-to-flavor mapping for 40+ file extensions and content-based language detection, while the debug module supports conditional compilation with -d:validatrixDebug for detailed tokenization logging.
2026-07-08 06:25:59 +02:00
|
|
|
|
2026-07-08 06:29:19 +02:00
|
|
|
- Nim >= 2.0.0
|
2026-07-15 06:59:03 +02:00
|
|
|
- `make` (optional; Makefile wraps build and test targets)
|
2026-07-08 10:19:01 +02:00
|
|
|
|
2026-07-15 06:59:03 +02:00
|
|
|
No configuration file. No environment variables. Zero setup beyond installing Nim.
|
2026-07-08 10:19:01 +02:00
|
|
|
|
2026-07-15 06:59:03 +02:00
|
|
|
## Building
|
2026-07-08 06:29:19 +02:00
|
|
|
|
|
|
|
|
```bash
|
2026-07-15 06:59:03 +02:00
|
|
|
make build # release binary → bin/nimcheck
|
|
|
|
|
make build-debug # -d:nimcheckDebug
|
|
|
|
|
nimble build # equivalent via nimble
|
2026-07-08 06:29:19 +02:00
|
|
|
```
|
|
|
|
|
|
2026-07-15 06:59:03 +02:00
|
|
|
## Testing
|
2026-07-08 06:29:19 +02:00
|
|
|
|
2026-07-08 10:19:01 +02:00
|
|
|
```bash
|
2026-07-15 06:59:03 +02:00
|
|
|
make test # full suite (~11 s)
|
|
|
|
|
make lint # compile with all hints and warnings
|
|
|
|
|
nim c -r tests/test_go.nim # single language
|
2026-07-08 10:19:01 +02:00
|
|
|
```
|
2026-07-08 06:29:19 +02:00
|
|
|
|
2026-07-15 06:59:03 +02:00
|
|
|
Suites: per-language basic and exhaustive tests, config formats, mixed files,
|
|
|
|
|
fuzz (null bytes, deep nesting, concurrent calls). See `tests/test_all.nim`.
|
2026-07-08 06:29:19 +02:00
|
|
|
|
2026-07-15 06:59:03 +02:00
|
|
|
## Project structure
|
2026-07-08 06:29:19 +02:00
|
|
|
|
2026-07-08 10:19:01 +02:00
|
|
|
```
|
|
|
|
|
.
|
2026-07-15 06:59:03 +02:00
|
|
|
├── Makefile
|
|
|
|
|
├── nimcheck.nimble
|
|
|
|
|
├── src/nimcheck.nim # public API and CLI
|
|
|
|
|
├── src/nimcheck/
|
|
|
|
|
│ ├── core/ # types, tokenizerbase, validatorbase, detector
|
|
|
|
|
│ ├── tokenizers/ # per-language lexers
|
|
|
|
|
│ ├── languages/ # per-language validators
|
|
|
|
|
│ └── reporting/ # error formatting
|
|
|
|
|
├── tests/ # test_all.nim + per-language suites
|
|
|
|
|
├── tests/fixtures/ # valid / invalid / edge_cases per language
|
|
|
|
|
├── docs/ # reference documentation
|
|
|
|
|
└── .gitea/workflows/ci.yml # Gitea Actions pipeline
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Documentation
|
|
|
|
|
|
|
|
|
|
| Document | Contents |
|
|
|
|
|
|----------|----------|
|
|
|
|
|
| [docs/API.md](docs/API.md) | Function reference, types, JSON schemas, CLI |
|
|
|
|
|
| [docs/ERRORS.md](docs/ERRORS.md) | Error codes, per-language triggers |
|
|
|
|
|
| [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) | Pipeline layers and detection order |
|
|
|
|
|
| [docs/STATUS.md](docs/STATUS.md) | Release status, verification, changelog |
|
|
|
|
|
| [docs/GITEA.md](docs/GITEA.md) | CI setup, default branch `master` |
|
|
|
|
|
| [CONTRIBUTING.md](CONTRIBUTING.md) | Development workflow, adding languages |
|
2026-07-08 10:01:58 +02:00
|
|
|
|
feat: add initial validatrix project with multi-language validator framework
Establish the Validatrix source code validation framework in Nim, including core detection, tokenization, and validation infrastructure for 10 languages (bash, HTML, JavaScript, Jinja, JSON, Nim, PHP, Python, TOML, YAML). The initial commit introduces the main validatrix.nim entry point with public API (validateSource, validateFile, inspectSource), a comprehensive test suite with per-language test files, build configuration via Makefile and .nimble, detailed LESSONS_LEARNED.md documenting 14 bug classes found during development, and a .gitignore excluding compiled binaries, logs, and build artifacts. The detector module provides extension-to-flavor mapping for 40+ file extensions and content-based language detection, while the debug module supports conditional compilation with -d:validatrixDebug for detailed tokenization logging.
2026-07-08 06:25:59 +02:00
|
|
|
## License
|
|
|
|
|
|
2026-07-15 06:59:03 +02:00
|
|
|
MIT — see [LICENSE](LICENSE).
|