Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Remove unnecessary exceptions from analysis_options.yaml #35054

Merged
merged 6 commits into from
Aug 2, 2022

Conversation

goderbauer
Copy link
Member

@goderbauer goderbauer commented Aug 1, 2022

Inspired by Dan's comment on #34986 I went through the other declared differences in analyzer options between the flutter/flutter and the flutter/engine repository. Turns out, some of these exceptions (namely import_internal_library, prefer_final_fields, and sort_constructors_first) are no longer necessary. The stated reason for why they are different from flutter/flutter don't appear to apply anymore.

This reduces the effective differences between flutter/flutter and flutter/engine down to three.

This PR also removes the special treatment of todo, missing_required_param, and missing_return as those are also no longer necessary as explained in flutter/flutter#108747.

@flutter-dashboard flutter-dashboard bot added the platform-web Code specifically for the web engine label Aug 1, 2022
@goderbauer goderbauer requested a review from dnfield August 1, 2022 18:46
Comment on lines 6026 to 6031
ImmutableBuffer buffer, {
required int width,
required int height,
int? rowBytes,
required PixelFormat pixelFormat,
}) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undo whitespace changes

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching that. Fixed.

Copy link
Contributor

@dnfield dnfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with nit

@yjbanov may want a chance to look at this

@goderbauer goderbauer requested a review from yjbanov August 1, 2022 19:54

final CkSurface skiaSurface;
final SubmitCallback submitCallback;
final bool _submitted; // ignore: unnecessary_null_comparison
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this // ignore: unnecessary_null_comparison referring to?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like dart fix messed up the comments. In general, unnecessary_null_comparison is ignored on a global level, so individual ignores are no longer needed. I will remove them here.

SurfaceFrame(this.skiaSurface, this.submitCallback)
: _submitted = false,
assert(skiaSurface != null), // ignore: unnecessary_null_comparison
assert(submitCallback != null); // ignore: unnecessary_null_comparison
assert(submitCallback != null);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like // ignore: unnecessary_null_comparison is still needed here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed, see other comment.

@@ -1044,6 +1039,10 @@ class _ParagraphCommand {
_CkParagraphPlaceholder placeholderStyle)
: this._(
_ParagraphCommandType.addPlaceholder, null, null, placeholderStyle);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separate constructors from the fields by an empty line.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -43,18 +64,14 @@ class SurfacePath implements ui.Path {
ui.PathFillType _fillType = ui.PathFillType.nonZero;
// Skia supports inverse winding as part of path fill type.
// For Flutter inverse is always false.
bool _isInverseFillType = false;
final bool _isInverseFillType = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A final bool field seems like an unnecessary variable.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed and updated code that was using it.

@@ -51,7 +51,7 @@ class RawRecordingCanvas extends BitmapCanvas implements ui.PictureRecorder {

late RecordingCanvas _canvas; // ignore: unused_field

bool _isRecording = true; // ignore: unused_field
final bool _isRecording = true; // ignore: unused_field
Copy link
Contributor

@yjbanov yjbanov Aug 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like RawRecordingCanvas class isn't used anywhere. I think it's dead code.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted.

Copy link
Contributor

@yjbanov yjbanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@goderbauer goderbauer added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 2, 2022
@auto-submit auto-submit bot merged commit d9a6777 into flutter:main Aug 2, 2022
@goderbauer goderbauer deleted the check branch August 2, 2022 16:20
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 2, 2022
betrevisan pushed a commit to betrevisan/engine that referenced this pull request Aug 5, 2022
emilyabest pushed a commit to emilyabest/engine that referenced this pull request Aug 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
autosubmit Merge PR when tree becomes green via auto submit App platform-web Code specifically for the web engine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants