Linter
Linter
Section titled “Linter”Wippy includes a built-in linter that performs type checking and static analysis on Lua code. Run it with wippy lint.
wippy lint # Check all Lua entrieswippy lint --level hint # Show all diagnostics including hintswippy lint --json # Output in JSON formatwippy lint --ns app # Check only the app namespacewippy lint --summary # Group results by error codeWhat Gets Checked
Section titled “What Gets Checked”The linter validates all Lua entry kinds:
function.lua- Functionslibrary.lua- Librariesprocess.lua- Processesworkflow.lua- Workflows
Bytecode entries hold compiled bytecode (fs/path/hash), not source, so they cannot be parsed or type-checked; the linter only checks source-bearing Lua entries (their .bc variants are skipped, though they may still appear in the total entry count).
Each entry is parsed, type-checked, and analyzed for correctness issues.
Severity Levels
Section titled “Severity Levels”Diagnostics have three severity levels:
| Level | Description |
|---|---|
error | Type errors and correctness issues that must be fixed |
warning | Likely bugs or problematic patterns |
hint | Style suggestions and informational notes |
Control which levels appear with --level:
wippy lint --level error # Errors onlywippy lint --level warning # Warnings and errors (default)wippy lint --level hint # EverythingError Codes
Section titled “Error Codes”Parse Errors
Section titled “Parse Errors”| Code | Description |
|---|---|
P0001 | Lua syntax error - source cannot be parsed |
Type Check Errors (E-series)
Section titled “Type Check Errors (E-series)”Type checker errors (E0001+) report issues found by the type system: type mismatches, undefined variables, invalid operations, and similar correctness problems. These are always reported as errors.
local x: number = "hello" -- E: string not assignable to number
local function add(a: number, b: number): number return a + bend
add("one", "two") -- E: string not assignable to numberLint Rule Warnings (W-series)
Section titled “Lint Rule Warnings (W-series)”Lint rules provide style and quality checks. Enable them with --rules:
wippy lint --rules| Code | Rule | Description |
|---|---|---|
W0001 | no-empty-blocks | Empty block statements |
W0002 | no-global-assign | Assignment to global variables |
W0003 | no-self-compare | Comparison of a value with itself |
W0004 | no-unused-vars | Unused local variables |
W0005 | no-unused-params | Unused function parameters |
W0006 | no-unused-imports | Unused import statements |
W0007 | no-shadowed-vars | Variable shadowing outer scope |
Without --rules, only type checking (P and E codes) is performed.
Filtering
Section titled “Filtering”By Namespace
Section titled “By Namespace”Check specific namespaces using --ns:
wippy lint --ns app # Exact namespace matchwippy lint --ns "app.*" # All under appwippy lint --ns app --ns lib # Multiple namespacesDependencies of selected entries are loaded for type checking but their diagnostics are not reported.
By Error Code
Section titled “By Error Code”Filter diagnostics by code:
wippy lint --code E0001wippy lint --code E0001 --code E0004By Count
Section titled “By Count”Limit the number of diagnostics shown:
wippy lint --limit 10 # Show first 10 issuesOutput Formats
Section titled “Output Formats”Table Format (Default)
Section titled “Table Format (Default)”Each diagnostic is displayed with source context, file location, and the error message. Results are sorted by entry, severity, and line number.
A summary line shows totals:
Checked 42 entries: 5 errors, 12 warningsSummary Format
Section titled “Summary Format”Group diagnostics by namespace and error code:
wippy lint --summaryBy namespace:
app 15 issues (5 errors, 10 warnings) lib 2 issues (2 warnings)
By error code:
E0001 [error ] 5 occurrences E0004 [error ] 3 occurrences
Checked 42 entries: 5 errors, 12 warningsJSON Format
Section titled “JSON Format”Machine-readable output for CI/CD integration:
wippy lint --json{ "diagnostics": [ { "entry_id": "app:handler", "code": "E0001", "severity": "error", "message": "string not assignable to number", "line": 10, "column": 5 } ], "total_entries": 42, "error_count": 5, "warning_count": 12, "hint_count": 0}Caching
Section titled “Caching”The linter caches results to speed up repeated runs. Cache keys are based on source code hash, method name, dependencies, and type system configuration.
Clear the cache if results seem stale:
wippy lint --cache-resetCI/CD Integration
Section titled “CI/CD Integration”Use JSON output and exit codes for automated checks:
wippy lint --json --level error > lint-results.jsonThe linter exits with code 0 when no errors are found, and non-zero when there are errors.
Example GitHub Actions step:
- name: Lint run: wippy lint --level warningFlags Reference
Section titled “Flags Reference”| Flag | Short | Default | Description |
|---|---|---|---|
--level | warning | Minimum severity level (error, warning, hint) | |
--json | false | Output in JSON format | |
--ns | Filter by namespace patterns | ||
--code | Filter by error codes | ||
--limit | 0 | Max diagnostics to show (0 = unlimited) | |
--summary | false | Group by error code | |
--no-color | false | Disable colored output | |
--rules | false | Enable lint rules (W-series style/quality checks) | |
--cache-reset | false | Clear cache before linting | |
--lock-file | -l | wippy.lock | Path to lock file |