Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExpoConfigRule ¶
type ExpoConfigRule struct {
// contains filtered or unexported fields
}
ExpoConfigRule checks Expo app.json / app.config for common issues.
func (*ExpoConfigRule) Applies ¶
func (r *ExpoConfigRule) Applies(fc FileContext) bool
func (*ExpoConfigRule) Check ¶
func (r *ExpoConfigRule) Check(fc FileContext) []Finding
type FileContext ¶
type FileContext struct {
Path string
RelPath string
Lines []string
Language string // "swift", "objc", "typescript", "javascript", "json", "plist"
}
FileContext holds a scanned file and its lines for pattern matching.
type Finding ¶
type Finding struct {
Severity Severity `json:"severity"`
Guideline string `json:"guideline"`
Title string `json:"title"`
Detail string `json:"detail"`
Fix string `json:"fix,omitempty"`
File string `json:"file"`
Line int `json:"line"` // 1-indexed
Code string `json:"code,omitempty"`
}
Finding is a single issue found in code.
type GlobalAntiPatternRule ¶
type GlobalAntiPatternRule interface {
Rule
// HasGlobalAntiPatterns returns true if this rule uses project-wide anti-pattern suppression.
HasGlobalAntiPatterns() bool
// AntiPatternMatched returns true if any anti-pattern matches the given file.
AntiPatternMatched(fc FileContext) bool
// RuleID returns the rule identifier.
RuleID() string
}
GlobalAntiPatternRule is implemented by rules that suppress findings when anti-patterns are found anywhere in the project (not just the current file).
type PatternRule ¶
type PatternRule struct {
// contains filtered or unexported fields
}
PatternRule matches regex patterns against file lines.
func (*PatternRule) AntiPatternMatched ¶
func (r *PatternRule) AntiPatternMatched(fc FileContext) bool
func (*PatternRule) Applies ¶
func (r *PatternRule) Applies(fc FileContext) bool
func (*PatternRule) Check ¶
func (r *PatternRule) Check(fc FileContext) []Finding
func (*PatternRule) HasGlobalAntiPatterns ¶
func (r *PatternRule) HasGlobalAntiPatterns() bool
func (*PatternRule) RuleID ¶
func (r *PatternRule) RuleID() string
type PlistKeyRule ¶
type PlistKeyRule struct {
// contains filtered or unexported fields
}
PlistKeyRule checks Info.plist for required privacy keys when certain frameworks are detected.
func (*PlistKeyRule) Applies ¶
func (r *PlistKeyRule) Applies(fc FileContext) bool
func (*PlistKeyRule) Check ¶
func (r *PlistKeyRule) Check(fc FileContext) []Finding
type Rule ¶
type Rule interface {
// Applies returns true if this rule should run on the given file.
Applies(fc FileContext) bool
// Check runs the rule and returns any findings.
Check(fc FileContext) []Finding
}
Rule is a code pattern check.
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner walks a project directory and runs pattern-based checks.
func NewScanner ¶
Click to show internal directories.
Click to hide internal directories.