MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / createLinter

Function createLinter

cmd/gosqlx/cmd/lint.go:399–417  ·  view source on GitHub ↗

createLinter creates a new linter instance with configured rules

()

Source from the content-addressed store, hash-verified

397
398// createLinter creates a new linter instance with configured rules
399func createLinter() *linter.Linter {
400 return linter.New(
401 // Whitespace rules (L001, L002, L003, L004, L005, L010)
402 whitespace.NewTrailingWhitespaceRule(), // L001
403 whitespace.NewMixedIndentationRule(), // L002
404 whitespace.NewConsecutiveBlankLinesRule(1), // L003
405 whitespace.NewIndentationDepthRule(4, 4), // L004
406 whitespace.NewLongLinesRule(lintMaxLength), // L005
407 whitespace.NewRedundantWhitespaceRule(), // L010
408
409 // Style rules (L006, L008, L009)
410 style.NewColumnAlignmentRule(), // L006
411 style.NewCommaPlacementRule(style.CommaTrailing), // L008
412 style.NewAliasingConsistencyRule(true), // L009
413
414 // Keyword rules (L007)
415 keywords.NewKeywordCaseRule(keywords.CaseUpper), // L007
416 )
417}
418
419func init() {
420 rootCmd.AddCommand(lintCmd)

Callers 4

lintRunFunction · 0.85
lintFromStdinFunction · 0.85
lintInlineSQLFunction · 0.85
TestCreateLinterFunction · 0.85

Calls 11

NewFunction · 0.92
NewMixedIndentationRuleFunction · 0.92
NewIndentationDepthRuleFunction · 0.92
NewLongLinesRuleFunction · 0.92
NewColumnAlignmentRuleFunction · 0.92
NewCommaPlacementRuleFunction · 0.92
NewKeywordCaseRuleFunction · 0.92

Tested by 1

TestCreateLinterFunction · 0.68