refactor(sight): split oversized static_rules.go for code clarity#12
Merged
Conversation
Move the defaultRules() built-in rule set (~855 lines) verbatim into a new same-package file static_rules_defaults.go, leaving static_rules.go with the analyzer logic and helpers. No behavior or API changes.
7695ccf to
b948250
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Pure mechanical refactor for code clarity only — splitting oversized Go files (>1000 LOC) into smaller, same-package files. Code is moved verbatim; there are no behavior, API, or exported-symbol changes.
File split
static_rules.gostatic_rules_defaults.go(new)static_rules.goretains theStaticRule/StaticAnalyzertypes, theAnalyze/AnalyzeFile/AnalyzeFileWithPathmethods, and theDetectLanguage/parseHunkNewStarthelpers. The large built-indefaultRules()rule set (~855 lines) moved verbatim into the newstatic_rules_defaults.goin the samesightpackage. A short pointer comment was left where the function used to be.No files were intentionally left over 1000 LOC.
Verification
All run with the package's standard toolchain (no cgo required):
go build ./...— OKgo vet ./...— OKgo test ./...— all packages passgolangci-lint run ./— 0 issuesgoimports/gofumpt— cleanTest plan
go vetcleanMade with Cursor