Skip to content

Commit 848bc77

Browse files
authored
Merge pull request #42 from phodal/enhance-code-review-guidelines
Enhance Augment Code Review guidelines with real-world insights
2 parents 63228b5 + 6245801 commit 848bc77

1 file changed

Lines changed: 33 additions & 9 deletions

File tree

.augment/code_review_guidelines.yaml

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,25 @@ areas:
3939
- "pkg/infrastructure/ast/**/*.go"
4040
rules:
4141
- id: "ast_parsing_correctness"
42-
description: "Ensure AST parsing handles edge cases correctly. Validate input before processing."
42+
description: "Ensure AST parsing handles edge cases correctly. Validate input before processing. Consider all grammar alternatives (e.g., generator expressions, comprehensions)."
4343
severity: "high"
44-
44+
4545
- id: "analysis_result_validation"
46-
description: "Validate analysis results for completeness and correctness before returning."
46+
description: "Validate analysis results for completeness and correctness before returning. Ensure no data is dropped or truncated during parsing."
4747
severity: "medium"
48-
48+
4949
- id: "language_support_consistency"
5050
description: "Ensure consistent behavior across different language analyzers (Java, Go, Python, etc.)."
5151
severity: "medium"
5252

53+
- id: "scope_tracking_correctness"
54+
description: "When tracking variable or symbol scope, use proper data structures to avoid misattribution. For nested scopes (e.g., nested classes, functions), use stacks or separate tracking per scope level to prevent outer scope data from being incorrectly assigned to inner scopes."
55+
severity: "high"
56+
57+
- id: "complete_syntax_coverage"
58+
description: "When parsing language constructs, ensure all syntax variants are handled. For example, when parsing function arguments, handle positional args, keyword args, unpacking operators (*args, **kwargs), and comprehensions."
59+
severity: "high"
60+
5361
domain_model_integrity:
5462
description: "Domain model and data structure integrity"
5563
globs:
@@ -88,15 +96,23 @@ areas:
8896
- id: "test_isolation"
8997
description: "Tests should be isolated and not depend on external state or other tests."
9098
severity: "high"
91-
99+
92100
- id: "test_data_fixtures"
93101
description: "Use test fixtures from _fixtures directory. Don't create test data in production code paths."
94102
severity: "medium"
95-
103+
96104
- id: "table_driven_tests"
97105
description: "Prefer table-driven tests for testing multiple scenarios of the same functionality."
98106
severity: "low"
99107

108+
- id: "edge_case_coverage"
109+
description: "When adding new features or fixing bugs, ensure tests cover edge cases and corner scenarios. For parsers, test nested structures, special operators, and all syntax variants."
110+
severity: "high"
111+
112+
- id: "test_completeness"
113+
description: "Tests should verify the complete behavior, not just the happy path. Check that all expected data is captured and nothing is dropped or misattributed."
114+
severity: "medium"
115+
100116
api_compatibility:
101117
description: "API and CLI compatibility"
102118
globs:
@@ -118,19 +134,27 @@ areas:
118134
- id: "avoid_magic_numbers"
119135
description: "Define constants for magic numbers and strings. Use meaningful names."
120136
severity: "low"
121-
137+
122138
- id: "function_complexity"
123139
description: "Keep functions focused and simple. Break down complex functions into smaller, testable units."
124140
severity: "medium"
125-
141+
126142
- id: "package_organization"
127143
description: "Follow the established package structure: domain, application, infrastructure, adapter."
128144
severity: "medium"
129-
145+
130146
- id: "exported_documentation"
131147
description: "All exported functions, types, and constants must have documentation comments."
132148
severity: "medium"
133149

150+
- id: "data_structure_choice"
151+
description: "Choose appropriate data structures for the problem. For nested scopes, use stacks. For shared state across iterations, consider when to use shared vs. per-instance collections."
152+
severity: "medium"
153+
154+
- id: "state_management"
155+
description: "Be careful with shared mutable state. When processing hierarchical or nested structures, ensure state is properly scoped and cleared at the right boundaries."
156+
severity: "high"
157+
134158
dependency_management:
135159
description: "Dependency and import management"
136160
globs:

0 commit comments

Comments
 (0)