Migrate tool/generator test to ConfigParser.loadConfig and clean up workflow#185
Closed
reidbaker-agent wants to merge 1 commit into
Closed
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the lint_skills_test.dart file to use resolvedRuleConfigs with RuleConfigPatch instances instead of resolvedRules. The feedback suggests making the entire map literal const to avoid redundant const keywords on individual RuleConfigPatch instances, which improves readability and aligns with Dart best practices.
Comment on lines
22
to
29
| resolvedRuleConfigs: { | ||
| 'check-relative-paths': const RuleConfigPatch( | ||
| severity: AnalysisSeverity.error, | ||
| ), | ||
| 'check-absolute-paths': const RuleConfigPatch( | ||
| severity: AnalysisSeverity.error, | ||
| ), | ||
| }, |
Contributor
There was a problem hiding this comment.
In Dart, when a collection literal is marked as const, all nested constructor calls and literals are implicitly const as well. You can make the entire map literal const and omit the redundant const keywords on individual RuleConfigPatch instances. This improves readability and ensures the entire map is a compile-time constant.
Suggested change
| resolvedRuleConfigs: { | |
| 'check-relative-paths': const RuleConfigPatch( | |
| severity: AnalysisSeverity.error, | |
| ), | |
| 'check-absolute-paths': const RuleConfigPatch( | |
| severity: AnalysisSeverity.error, | |
| ), | |
| }, | |
| resolvedRuleConfigs: const { | |
| 'check-relative-paths': RuleConfigPatch( | |
| severity: AnalysisSeverity.error, | |
| ), | |
| 'check-absolute-paths': RuleConfigPatch( | |
| severity: AnalysisSeverity.error, | |
| ), | |
| }, |
References
- Effective Dart recommends preferring const over const constructor calls. When a collection literal is prefixed with const, nested constructor calls and literals are implicitly const and do not need the const keyword. (link)
reidbaker-agent
force-pushed
the
migrate-generator-skills-test-2026-07-20
branch
from
July 20, 2026 20:12
aec31fb to
66146d5
Compare
reidbaker-agent
force-pushed
the
migrate-generator-skills-test-2026-07-20
branch
from
July 20, 2026 20:13
66146d5 to
fce05cc
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.
Migrates
tool/generator/test/lint_skills_test.dartto useConfigParser.loadConfigand createstool/generator/dart_skills_lint.yaml.validateSkillscall intool/generator/test/lint_skills_test.dartto load configuration dynamically viaConfigParser.loadConfig().validate_skillsCLI job from.github/workflows/dart_skills_lint_workflow.yaml.dart analyze --fatal-infos(0 issues) anddart test(100% tests passed).