-
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
CPLAT-6056: Warn consumers if part directive is present but there's no generated output #302
Conversation
Security InsightsNo security relevant content was detected by automated scans. Action Items
Questions or Comments? Reach out on Slack: #support-infosec. |
@@ -90,6 +90,26 @@ main() { | |||
reason: 'Expected a WARNING log for the missing over_react part.'); | |||
}); | |||
|
|||
test('warns if .over_react.g.dart part directive is present and no delcarations are present, but no code is generated', () async { |
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.
#typo: "delcarations" -> "declarations"
lib/src/builder/builder.dart
Outdated
log.warning('Missing "part \'$expectedPart\';".'); | ||
} | ||
|
||
await _writePart(buildStep, outputId, outputs); | ||
} else { | ||
if (hasOutputPartDirective()) { | ||
log.warning('An over react part directive was found in ${buildStep.inputId.path}, but no code was generated.'); |
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.
It might be good to indicate potential causes of this so that the user can attempt to correct them. (E.g., "The part directive may be unnecessary if the file does not contain any concrete components.")
Co-Authored-By: Evan Weible <[email protected]>
Co-Authored-By: Evan Weible <[email protected]>
…eact into warn_missing_gen_has_part
QA +1
|
@Workiva/release-management-p |
Motivation
In cases where an
.over_react.g.dart
part directive are included in a file where there are no generations, the consumer doesn't get any error or warning messages from this builder.Changes
Log a warning when a part directive exists, but there is no output.
Release Notes
Review
See CONTRIBUTING.md for more details on review types (+1 / QA +1 / +10) and code review process.
Please review: @greglittlefield-wf @aaronlademann-wf @seanburke-wf
QA Checklist
Merge Checklist
While we perform many automated checks before auto-merging, some manual checks are needed: