-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validate part directive for libs with parts #576
Validate part directive for libs with parts #576
Conversation
Security InsightsNo security relevant content was detected by automated scans. Action Items
Questions or Comments? Reach out on Slack: #support-infosec. |
… into link-2020/validate_generated_part_for_parent
tools/analyzer_plugin/lib/src/diagnostic/boilerplate_validator.dart
Outdated
Show resolved
Hide resolved
tools/analyzer_plugin/lib/src/diagnostic/boilerplate_validator.dart
Outdated
Show resolved
Hide resolved
@@ -67,6 +87,8 @@ class BoilerplateValidatorDiagnostic extends DiagnosticContributor { | |||
// Do not lint anything that is not a likely boilerplate member that will actually get generated. | |||
if (member.versionConfidences.toList().every((vcp) => vcp.confidence <= Confidence.neutral)) continue; | |||
|
|||
if (isPart(result.unit)) continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of this, there's no error if components are declared in parts and there's no generated import in the main library.
Sorry, I can't remember; we going to handle that case in a separate PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For posterity: we'll handle this separately
QA +1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
@@ -238,3 +229,11 @@ extension<E> on Iterable<E> { | |||
}); | |||
} | |||
} | |||
|
|||
// TODO use the version from over_react instead after initial release |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added #585 to address this TODO.
Fixes #522
Motivation
The boiler plate validation logic doesn't currently account or the case where the component declarations are in a
part of
file.Changes
part of
, just run the boilerplate validation, but not any part directive validation.Release Notes
Review
See CONTRIBUTING.md for more details on review types (+1 / QA +1 / +10) and code review process.
Please review:
QA Checklist
Merge Checklist
While we perform many automated checks before auto-merging, some manual checks are needed: