Module lint

Module lint 

Source
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.
BaselineEntry
A single baseline entry representing a known lint issue.
BaselineLintResult
Result of linting with baseline filtering.
BaselineSummary
Summary of baseline contents.
CacheEntry
A cached lint result for a single file.
CacheStats
Statistics about the lint cache.
CachedDiagnostic
Minimal diagnostic representation for caching.
CliOverrides
Command-line overrides for lint levels.
CustomRule
Custom lint rule definition.
CustomRuleChecker
Custom rule checker.
CustomRuleMatch
Result of applying a custom rule.
CustomRulesFile
Custom rules configuration file.
DirectoryLintResult
Result of linting a directory.
FixResult
Result of applying fixes to source code.
GitIntegration
Git integration for linting only changed files.
IgnorePatterns
Ignore pattern configuration.
IncrementalLintResult
Result of incremental linting.
LintCache
Cache for storing file hashes and lint results.
LintConfig
Runtime configuration for the linter.
LintConfigFile
TOML-serializable configuration for the linter.
LintReport
Lint report for trend tracking.
LintSettings
Lint settings section of config file.
LintStats
Statistics about a lint run.
Linter
The main linter struct.
LspCodeAction
Code action for quick fixes.
LspDiagnostic
LSP-compatible diagnostic.
LspLintResult
Result of LSP lint operation.
LspRelatedInfo
Related diagnostic information.
LspServerState
LSP server state (for use with tower-lsp).
LspTextEdit
Text edit for code actions.
SarifArtifactChange
SarifArtifactLocation
SarifConfiguration
SarifContent
SarifDriver
SarifFix
SarifLocation
SarifMessage
SarifPhysicalLocation
SarifRegion
SarifReplacement
SarifReport
SARIF (Static Analysis Results Interchange Format) output.
SarifResult
SarifRule
SarifRuleProperties
SarifRun
SarifTool
Suppression
A parsed inline suppression directive.
TrendData
Trend data for multiple reports.
TrendSummary
Trend summary.
WatchConfig
Watch mode configuration.
WatchResult
Result of a watch iteration.

Enums§

CiFormat
CI annotation format (for GitHub Actions, etc).
CustomPattern
Pattern matching for custom rules.
LintCategory
Lint rule categories for grouping and bulk enable/disable.
LintId
Unique identifier for a lint rule.
LintLevel
Lint severity level.
LspSeverity
LSP diagnostic severity mapping.
TrendDirection
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.