refactor(tok): split oversized files for code clarity#59
Merged
Conversation
Move the extensionLanguageMap literal and DetectLanguageByExtension into a new same-package file chunker_extensions.go to keep chunker.go under 1000 LOC. Pure mechanical move; no behavior or API changes.
Move the Performance, Configuration, concurrency, CompactionSchema, and token-estimation-precision integration tests into a new same-package file integration_advanced_test.go to keep integration_test.go under 1000 LOC. Pure mechanical move; no test behavior changes.
7a56535 to
0bd9de8
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 — split two oversized Go files (>1000 LOC) into smaller, cohesive, same-package files. Code was moved verbatim; no behavior, API, or exported-symbol changes.
Splits (before → after LOC)
chunker.gochunker_extensions.gointegration_test.gointegration_advanced_test.gochunker.go→chunker_extensions.goMoved the large
extensionLanguageMapdata literal andDetectLanguageByExtension(extension→language mapping) out ofchunker.go.integration_test.go→integration_advanced_test.goMoved the Performance, Configuration, concurrency,
CompactionSchema, and token-estimation-precision integration tests out ofintegration_test.go. The original retains the full-pipeline, reversibility, token-estimation, language-detection, and edge-case sections.All files are now under 1000 LOC. No file was intentionally left over 1000.
Verification
goimports -won all touched filesgo build ./...— greengo vet ./...— greengo test ./...— all packages passgolangci-lint runon the root package —0 issuesNo cgo needed (pure-Go module;
modernc.org/sqlite).Made with Cursor