git clone https://github.com/ailinter/ailinter.git
cd ailinter
make build # Builds to bin/ailinter
make test # Run all tests
make lint # Go vetRequirements: Go 1.25+
- Follow Go idioms:
gofmt,go vet, table-driven tests - No empty interface (
interface{}) in new code — prefer generics or concrete types - Error messages start lowercase
- Package names are single word, lowercase
- Test functions use descriptive names:
TestFeature_Scenario
- Coverage threshold: 80%+ on line, branch, and function coverage
- Every new feature must include unit tests
- Every new detector must include test fixtures in
testdata/ - Run
make test-coverbefore submitting
-
make lintpasses -
make testpasses -
make test-covershows >=80% line coverage -
make benchshows no regressions - New features include tests and testdata fixtures
-
ailinter check .on changed files shows no regressions - No hardcoded secrets (
ailinter check --no-secrets .is clean)
cmd/ailinter/ # CLI entry point (cobra commands)
internal/
analyzer/ # Orchestrator: runs all detectors, computes 0-100 score
cli/ # check, init, mcp commands + output formatters
config/ # Persistent JSON config at ~/.config/ailinter/config.json
mcp/ # MCP stdio server + 7 tool handlers
parser/ # 17 code smell detectors + git hotspot analysis
refactoring/ # Embedded .md patterns + lookup engine
secrets/ # Gitleaks v8 wrapper (150+ rules)
testdata/ # Language-specific test fixtures
- Create detector function in
internal/parser/ - Add threshold fields to
parser.Thresholdsinthresholds.go - Wire into
analyzer.Analyze()inanalyzer.go - Add test fixture in
testdata/<smell_name>/ - Add unit test in
internal/parser/ - Add integration test in
internal/analyzer/ - Add refactoring pattern in
internal/refactoring/patterns/
- Add extension mapping in
parser.DetectedLanguage()intypes.go - Add threshold profile in
parser.DefaultThresholds()inthresholds.go - If language needs function detection, implement in
parser/bloat_langs.go - Add
isSourceFileextension incli/check.go - Add test fixture files in
testdata/ - Add language-specific tests in
parser/detector_test.go
git tag -a v0.5.0 -m "v0.5.0"
git push origin v0.5.0
make release # Cross-compile for all platformsOpen an issue on GitHub or start a discussion.