feat : clean the whole codebase#6
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Free Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
This pull request refactors and clarifies the codebase, particularly in the PostgreSQL parser, and significantly improves the contributing documentation. The main changes include enhanced variable naming for clarity, modularization of the schema linking logic, and a major rewrite of the contribution guide to focus on maintainability, explicit standards, and clearer instructions for contributors.
Documentation and Contribution Guide Improvements:
CONTRIBUTING.mdfile was rewritten to emphasize core design principles (explicit naming, SRP, code style), clarify architectural/testing rules, and provide a more maintainable and readable structure. It replaces the "types of contributions" section with design principles, details code and architectural rules, and updates the workflow to usego build/go testinstead ofmake. Conventional Commit guidelines are now included. [1] [2] [3] [4] [5] [6]Parser Code Refactoring and Clarity:
internal/parser/postgresql/adapter_cgo.gowere rewritten to be more explicit and descriptive, replacing short/cryptic names with clear, full-word alternatives (e.g.,stmt→statement,col→column,tc→tableConstraint). This improves code readability and maintainability. [1] [2] [3] [4]fkActionString→mapForeignKeyAction, and all switch/case variables use descriptive names.Schema Linking Logic Modularization:
internal/parser/postgresql/link.gowas refactored: the monolithiclinkmethod was split into smaller, focused helpers (buildTableIndex,resolveForeignKeys) for better separation of concerns and readability.These changes collectively improve code quality, contributor experience, and future maintainability.## What does this PR do?
Why is it needed?
Closes #
How was it tested?
Does it change any existing behavior?
Checklist
make testpasses (go test ./... -race)make lintpasses (golangci-lint run ./...)time.Now()or unseeded randomness in the generation pipelinemake test-golden UPDATE=true)