Linting
Built-in static analysis to catch style issues and code smells without executing your code.
Usage
# Lint all .sl files in current directory (recursive)
soli lint
# Lint a specific directory
soli lint src/
# Lint a single file
soli lint app/main.sl
Exit codes
0 — no issues found. 1 — one or more issues found.
Output Format
Each issue is reported on a single line with the file path, line, column, rule, and message:
app/main.sl:12:5 - [naming/snake-case] variable 'myVar' should use snake_case
app/main.sl:30:9 - [smell/unreachable-code] unreachable code after return statement
2 issue(s) found in 1 file(s)
Rules
Naming
naming/snake-case
Variables, functions, methods, and parameters should use snake_case.
# Bad
let myVar = 10;
def processData end
# Good
let my_var = 10;
def process_data end
naming/pascal-case
Classes and interfaces should use PascalCase.
# Bad
class my_class end
interface data_store end
# Good
class MyClass end
interface DataStore end
Style
style/empty-block
Blocks should not be empty. Add a comment or remove the block.
style/line-length
Lines should not exceed 120 characters.
Code Smells
smell/unreachable-code
Code after a return statement is unreachable and will never execute.
def example
return 42;
print("never reached"); # Warning: unreachable code
end
smell/empty-catch
Catch blocks should not be empty. Silently swallowing errors hides bugs.
# Bad - error silently ignored
try
risky();
catch e
end
# Good - at least log the error
try
risky();
catch e
print("Error: " + str(e));
end
smell/deep-nesting
Nesting depth should not exceed 4 levels. Consider extracting logic into separate functions.
smell/duplicate-methods
A class should not have two methods with the same name.
Editor Integration
The VS Code / Cursor extension runs soli lint automatically on save and displays warnings inline in the Problems panel.
Settings
soli.lint.enable— Enable/disable linting (default:true)soli.lint.onSave— Run linter on file save (default:true)soli.lint.executablePath— Path to thesolibinary (default:"soli")