Expand description
Linter for Sigil source code.
Provides static analysis to catch common mistakes, style issues, and Sigil-specific patterns that may cause problems.
§Configuration
The linter can be configured via .sigillint.toml:
[lint]
suggest_unicode = true
check_naming = true
max_nesting_depth = 6
[lint.levels]
unused_variable = "allow" # allow, warn, or deny
shadowing = "warn"
deep_nesting = "deny"Structs§
- Baseline
- A baseline file containing known lint issues.
- Baseline
Entry - A single baseline entry representing a known lint issue.
- Baseline
Lint Result - Result of linting with baseline filtering.
- Baseline
Summary - Summary of baseline contents.
- Cache
Entry - A cached lint result for a single file.
- Cache
Stats - Statistics about the lint cache.
- Cached
Diagnostic - Minimal diagnostic representation for caching.
- CliOverrides
- Command-line overrides for lint levels.
- Custom
Rule - Custom lint rule definition.
- Custom
Rule Checker - Custom rule checker.
- Custom
Rule Match - Result of applying a custom rule.
- Custom
Rules File - Custom rules configuration file.
- Directory
Lint Result - Result of linting a directory.
- FixResult
- Result of applying fixes to source code.
- GitIntegration
- Git integration for linting only changed files.
- Ignore
Patterns - Ignore pattern configuration.
- Incremental
Lint Result - Result of incremental linting.
- Lint
Cache - Cache for storing file hashes and lint results.
- Lint
Config - Runtime configuration for the linter.
- Lint
Config File - TOML-serializable configuration for the linter.
- Lint
Report - Lint report for trend tracking.
- Lint
Settings - Lint settings section of config file.
- Lint
Stats - Statistics about a lint run.
- Linter
- The main linter struct.
- LspCode
Action - Code action for quick fixes.
- LspDiagnostic
- LSP-compatible diagnostic.
- LspLint
Result - Result of LSP lint operation.
- LspRelated
Info - Related diagnostic information.
- LspServer
State - LSP server state (for use with tower-lsp).
- LspText
Edit - Text edit for code actions.
- Sarif
Artifact Change - Sarif
Artifact Location - Sarif
Configuration - Sarif
Content - Sarif
Driver - Sarif
Fix - Sarif
Location - Sarif
Message - Sarif
Physical Location - Sarif
Region - Sarif
Replacement - Sarif
Report - SARIF (Static Analysis Results Interchange Format) output.
- Sarif
Result - Sarif
Rule - Sarif
Rule Properties - Sarif
Run - Sarif
Tool - Suppression
- A parsed inline suppression directive.
- Trend
Data - Trend data for multiple reports.
- Trend
Summary - Trend summary.
- Watch
Config - Watch mode configuration.
- Watch
Result - Result of a watch iteration.
Enums§
- CiFormat
- CI annotation format (for GitHub Actions, etc).
- Custom
Pattern - Pattern matching for custom rules.
- Lint
Category - Lint rule categories for grouping and bulk enable/disable.
- LintId
- Unique identifier for a lint rule.
- Lint
Level - Lint severity level.
- LspSeverity
- LSP diagnostic severity mapping.
- Trend
Direction - Trend direction.
Constants§
- CACHE_
FILE - Default cache file name.
- PRE_
COMMIT_ HOOK - Pre-commit hook script content.
Functions§
- apply_
fixes - Apply fix suggestions from diagnostics to source code.
- collect_
sigil_ files_ filtered - Collect sigil files respecting ignore patterns.
- config_
with_ overrides - Create a LintConfig with CLI overrides applied.
- explain_
lint - Print detailed documentation for a lint rule.
- filter_
ignored - Filter files based on ignore patterns.
- find_
baseline - Find and load baseline from standard locations.
- find_
cache - Find and load cache from standard location.
- generate_
ci_ annotations - Generate CI annotations from lint result.
- generate_
html_ report - Generate HTML report.
- generate_
pre_ commit_ hook - Generate pre-commit hook.
- generate_
sarif - Generate a SARIF report for linting results.
- generate_
sarif_ for_ directory - Generate a SARIF report for directory linting results.
- lint_
and_ fix - Lint and optionally apply fixes to source code.
- lint_
changed_ files - Lint only changed files (git diff mode).
- lint_
changed_ since - Lint files changed since a base ref.
- lint_
directory - Lint all Sigil files in a directory recursively (sequential).
- lint_
directory_ filtered - Lint directory with ignore patterns.
- lint_
directory_ incremental - Lint a directory with caching for incremental performance.
- lint_
directory_ parallel - Lint all Sigil files in a directory recursively (parallel).
- lint_
file - Lint a source file with default configuration.
- lint_
files - Lint a list of specific files.
- lint_
for_ lsp - Lint for LSP integration.
- lint_
source - Lint source code string (parses and lints).
- lint_
source_ with_ config - Lint source code with custom configuration.
- lint_
source_ with_ overrides - Lint source with CLI overrides.
- lint_
with_ baseline - Lint with baseline filtering.
- lint_
with_ custom_ rules - Lint with custom rules.
- list_
lints - List all available lint rules grouped by category.
- parse_
suppressions - Parse inline suppression comments from source code.
- save_
html_ report - Save HTML report to file.
- watch_
directory - Watch a directory for changes and lint on each change.