Skip to main content

Crate shuck_linter

Crate shuck_linter 

Source
Expand description

Linting and fix application for shell scripts parsed by the Shuck toolchain.

This crate combines parser output, semantic analysis, suppressions, and rule metadata into a diagnostics pipeline used by shuck check.

Modules§

rules
Rule implementations and rule-oriented helper modules.

Structs§

AddIgnoreParseError
Suppression directives, shellcheck mappings, and rewrite helpers.
AddIgnoreResult
Suppression directives, shellcheck mappings, and rewrite helpers.
AmbientContractConfig
User-configurable ambient contract settings.
AmbientContractEffects
User-facing contract effects.
AmbientContractSpec
One user-authored ambient contract specification.
AmbientFunctionContractSpec
Function-specific contract effects.
AmbientShellOptions
Linter configuration and per-file ignore types.
AmbiguousArrayReference
Extracted structural facts available to rules and callers.
AnalysisRequest
Request object for running linter analysis.
AnalysisResult
Combined semantic model and diagnostic output for a file analysis pass.
AppliedFixes
Autofix types and fix application helpers.
ArithmeticLiteralFact
Extracted structural facts available to rules and callers.
AssignmentFacts
Fact collection types and stable identifiers into those collections.
BacktickFragmentFact
Extracted structural facts available to rules and callers.
C001RuleOptions
Linter configuration and per-file ignore types. Behavior overrides for C001 unused-assignment analysis.
C063RuleOptions
Linter configuration and per-file ignore types. Behavior overrides for C063 overwritten/unreached function analysis.
C158RuleOptions
Linter configuration and per-file ignore types. Behavior overrides for C158 implicit global assignment analysis.
C159RuleOptions
Linter configuration and per-file ignore types. Behavior overrides for C159 mutable-global analysis.
C160RuleOptions
Linter configuration and per-file ignore types. Behavior overrides for C160 unanchored source path analysis.
C161RuleOptions
Linter configuration and per-file ignore types. Behavior overrides for C161 function-call ordering analysis.
Checker
Primary checker API for walking facts and emitting diagnostics.
CommandFact
Extracted structural facts available to rules and callers.
CommandFactQueries
Fact collection types and stable identifiers into those collections.
CommandFactRef
Extracted structural facts available to rules and callers.
CommandFacts
Extracted structural facts available to rules and callers.
CommandId
Fact collection types and stable identifiers into those collections. Stable identifier for a semantic command in the recorded command stream.
CompatFacts
Fact collection types and stable identifiers into those collections.
CompiledPerFileIgnoreList
Linter configuration and per-file ignore types.
ConditionalBareWordFact
Extracted structural facts available to rules and callers.
ConditionalBinaryFact
Extracted structural facts available to rules and callers.
ConditionalFact
Extracted structural facts available to rules and callers.
ConditionalMixedLogicalOperatorFact
Extracted structural facts available to rules and callers.
ConditionalOperandFact
Extracted structural facts available to rules and callers.
ConditionalPortabilityFacts
Extracted structural facts available to rules and callers.
ConditionalUnaryFact
Extracted structural facts available to rules and callers.
Diagnostic
Rule diagnostics and severity levels.
Edit
Autofix types and fix application helpers.
EffectiveAmbientContracts
Stable snapshot of the enabled ambient contract set for cache keys.
ExpansionAnalysis
ExpansionHazards
FactSpan
Fact collection types and stable identifiers into those collections.
FileDescriptionCommentFact
Extracted structural facts available to rules and callers.
Fix
Autofix types and fix application helpers.
ForHeaderFact
Extracted structural facts available to rules and callers.
FunctionCallArityFacts
Extracted structural facts available to rules and callers.
FunctionHeaderFact
Extracted structural facts available to rules and callers.
GlobPatternBehavior
Option-sensitive shell behavior enums reused by linter facts and rules. Option-sensitive pattern operators available to glob and shell-pattern facts.
IndexedArrayReferenceFragment
Extracted structural facts available to rules and callers.
LegacyArithmeticFragmentFact
Extracted structural facts available to rules and callers.
LinterFacts
Fact collection types and stable identifiers into those collections.
LinterRuleOptions
Linter configuration and per-file ignore types. Per-rule behavior overrides applied during lint analysis.
LinterSemanticArtifacts
Semantic model plus linter-private traversal artifacts needed to build facts.
LinterSettings
Linter configuration and per-file ignore types.
ListFact
Extracted structural facts available to rules and callers.
ListOperatorFact
Extracted structural facts available to rules and callers.
LoopHeaderWordFact
Extracted structural facts available to rules and callers.
NativeZshScalarArrayReference
Extracted structural facts available to rules and callers.
NormalizedCommand
Fact collection types and stable identifiers into those collections.
NormalizedDeclaration
Fact collection types and stable identifiers into those collections.
PerFileIgnore
Linter configuration and per-file ignore types.
PipelineFact
Extracted structural facts available to rules and callers.
PipelineOperatorFact
Extracted structural facts available to rules and callers.
PipelineSegmentFact
Extracted structural facts available to rules and callers.
PositionalParameterFragmentFact
Extracted structural facts available to rules and callers.
RedirectFact
Extracted structural facts available to rules and callers.
RedirectTargetAnalysis
Extracted structural facts available to rules and callers.
ResolvedAmbientContracts
Compiled ambient contracts shared by file-entry and plugin-request analysis.
ResolvedAmbientRequestContracts
Plugin-request contract effects split by imported facts and requesting-file consumption.
RuleMetadata
Rule metadata lookup utilities.
RuleSet
Sets of enabled or disabled rules.
RuntimeLiteralAnalysis
S078RuleOptions
Linter configuration and per-file ignore types. Behavior overrides for S078 shebang shell policy.
S079RuleOptions
Linter configuration and per-file ignore types. Behavior overrides for S079 shebang invocation form policy.
S080RuleOptions
Linter configuration and per-file ignore types. Behavior overrides for S080 script size policy.
S081RuleOptions
Linter configuration and per-file ignore types. Behavior overrides for S081 file description comments.
S082RuleOptions
Linter configuration and per-file ignore types. Behavior overrides for S082 TODO-style comment formatting.
S083RuleOptions
Linter configuration and per-file ignore types. Behavior overrides for S083 missing function documentation.
S084RuleOptions
Linter configuration and per-file ignore types. Behavior overrides for S084 function documentation content.
S085RuleOptions
Linter configuration and per-file ignore types. Behavior overrides for S085 main entrypoint analysis.
ScriptLineCountFact
Extracted structural facts available to rules and callers.
SelectHeaderFact
Extracted structural facts available to rules and callers.
SelectorRequiredArrayReference
Extracted structural facts available to rules and callers.
ShellCheckCodeMap
Suppression directives, shellcheck mappings, and rewrite helpers. Maps ShellCheck SC codes to Shuck rules.
SimpleTestFact
Extracted structural facts available to rules and callers.
SingleQuotedFragmentFact
Extracted structural facts available to rules and callers.
SourceFacts
Fact collection types and stable identifiers into those collections.
StatementFact
Extracted structural facts available to rules and callers.
SubstitutionFact
Extracted structural facts available to rules and callers.
SuppressionDirective
Suppression directives, shellcheck mappings, and rewrite helpers. A parsed suppression directive from a comment.
SuppressionIndex
Suppression directives, shellcheck mappings, and rewrite helpers. Per-file suppression index.
WordClassification
WordFacts
Fact collection types and stable identifiers into those collections.
WordOccurrence
WordOccurrenceIter
WordOccurrenceRef

Enums§

AmbientContractActivation
Contract activation type.
Applicability
Autofix types and fix application helpers.
ArithmeticLiteralBehavior
Option-sensitive shell behavior enums reused by linter facts and rules. How arithmetic number literals are interpreted at a source offset.
ArithmeticLiteralKind
Extracted structural facts available to rules and callers.
Category
Rule identifiers, categories, and registry lookup helpers.
CommandSubstitutionKind
Command-substitution classification exposed by fact APIs.
ConditionalNodeFact
Extracted structural facts available to rules and callers.
ConditionalOperatorFamily
Extracted structural facts available to rules and callers.
DeclarationKind
Fact collection types and stable identifiers into those collections.
ExpansionContext
ExpansionValueShape
FieldSplittingBehavior
Option-sensitive shell behavior enums reused by linter facts and rules. Whether unquoted expansion results are subject to field splitting.
FixAvailability
Autofix types and fix application helpers.
GlobDotBehavior
Option-sensitive shell behavior enums reused by linter facts and rules. Whether glob patterns match dot-prefixed path segments without an explicit dot.
GlobFailureBehavior
Option-sensitive shell behavior enums reused by linter facts and rules. How unmatched glob patterns behave.
IndexedArrayReferenceFragmentFact
Extracted structural facts available to rules and callers.
NamedGroup
Rule selector parsing types.
PathnameExpansionBehavior
Option-sensitive shell behavior enums reused by linter facts and rules. Whether pathname expansion applies to literal globs and substitution results.
PatternOperatorBehavior
Option-sensitive shell behavior enums reused by linter facts and rules. Whether a zsh pattern-operator family is active.
PlainUnindexedArrayReferenceFact
Extracted structural facts available to rules and callers.
RedirectDevNullStatus
Extracted structural facts available to rules and callers.
RedirectTargetKind
Extracted structural facts available to rules and callers.
Rule
Rule identifiers, categories, and registry lookup helpers.
RuleSelector
S083FunctionDocRequirement
Linter configuration and per-file ignore types. Which functions require a leading documentation comment for S083.
SelectorParseError
Severity
Rule diagnostics and severity levels.
ShellCheckLevel
Rule metadata lookup utilities.
ShellDialect
Shell dialect selection used by the linter.
SimpleTestOperatorFamily
Extracted structural facts available to rules and callers.
SimpleTestShape
Extracted structural facts available to rules and callers.
SimpleTestSyntax
Extracted structural facts available to rules and callers.
SubscriptIndexBehavior
Option-sensitive shell behavior enums reused by linter facts and rules. How indexed array subscripts are interpreted at a source offset.
SubstitutionHostKind
Extracted structural facts available to rules and callers.
SubstitutionOutputIntent
Extracted structural facts available to rules and callers.
SudoFamilyInvoker
Extracted structural facts available to rules and callers.
SuppressionAction
Suppression directives, shellcheck mappings, and rewrite helpers.
SuppressionSource
Suppression directives, shellcheck mappings, and rewrite helpers.
TestOperandClass
WordExpansionKind
WordFactContext
WordFactHostKind
WordLiteralness
WordQuote
WordSubstitutionShape
WrapperKind
Fact collection types and stable identifiers into those collections.

Traits§

Violation
Trait implemented by rule-specific diagnostic payloads.

Functions§

add_ignores_to_path
Suppression directives, shellcheck mappings, and rewrite helpers.
add_ignores_to_path_with_resolvers
Suppression directives, shellcheck mappings, and rewrite helpers.
analyze
Builds semantic facts and linter diagnostics for a request.
apply_fixes
Autofix types and fix application helpers.
build_ignore_edit_for_line
Suppression directives, shellcheck mappings, and rewrite helpers.
code_to_rule
Rule identifiers, categories, and registry lookup helpers.
leading_literal_word_prefix
lint
Lints a request and returns diagnostics.
parse_directives
Suppression directives, shellcheck mappings, and rewrite helpers. Parse all suppression directive candidates from a file’s comments.
rule_metadata
Rule metadata lookup utilities.
rule_metadata_by_code
Rule metadata lookup utilities.