ROSAENG-62490 | refactor: Add lint rules to enforce environmental boundaries - #3449
Conversation
… boundaries - Add depguard deny list to prohibit imports defined in ARCHITECTURE.md (reporter, output, interactive, arguments, color, debug, commands, rosa, options, aws/profile, aws/region, aws/commandbuilder) - Add nolint:depguard annotations to pre-existing internal import violations in files already within whole-files lint scope - Add nolint:forbidigo annotations to pre-existing fmt.Print and os.Exit violations in files already within whole-files lint scope
📝 WalkthroughWalkthroughThe pull request enables Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 14 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (14 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: markirish The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
PR Summary
Adds CI-enforced checks to prevent disallowed code patterns (e.g. calling os.Exit from
/pkg), and prevent disallowed dependency directions (core layer -> CLI). Enforces architectural patterns that have been laid out inguidelines/ARCHITECTURE.mdandguidelines/refactor/pkg-architecture.mdDetailed Description of the Issue
As files are touched,
//nolint:forbidgoand//nolint:depguardwill have to be added until files are refactored as part of this initiative.Related Issues and PRs
Type of Change
Previous Behavior
Bad dependency imports and disallowed code patterns were allowed
Behavior After This Change
Dependency imports as laid out in
ARCHITECTURE.mdandrefactor/pkg-architecture.mdare enforced.How to Test (Step-by-Step)
Preconditions
Test Steps
/cmdin/pkg) or incorrect code smell (e.g./pkgcallingos.Exitor writing tostdout)Expected Results
Linter should catch the architectural violations
Proof of the Fix
Breaking Changes
Developer Verification Checklist
[JIRA-TICKET] | [TYPE]: <MESSAGE>.make install-hookshas been run in this clone.make testpasses.make lintpasses.make rosapasses.Summary by CodeRabbit