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

Conversation

@dnfield
Copy link
Contributor

@dnfield dnfield commented Jan 8, 2019

This PR does a few things:

  1. Remove deprecated items from analysis options
  2. Update pubspec.yaml in the testing directory to become aware of the host build's dart:ui stuff
  3. Fix up analysis issues in test files (generally things like specifying types, using final and const)
  4. Removing optional new from test files - I didn't touch this in the acutal Dart implementation files
  5. Adding an ignore directive to the implementation files for native keyword usage outside the SDK, and in a few places ignoring unused elements (until Analysis should not mark a member decorated with @pragma('vm:entry-point') as unused dart-lang/sdk#35164 is resolved)

Locally, this resolves all dart analysis issues in VSCode when working with the engine repo, and should resolve the issues reported in Dart-Code/Dart-Code#692!

@dnfield dnfield requested review from Hixie and tvolkert January 8, 2019 00:20
@dnfield
Copy link
Contributor Author

dnfield commented Jan 8, 2019

/cc @zanderso - I added some ignores to Fuchsia specific files, not sure if there's a better way to handle that though (and I'm assuming it won't break anything, but it'd be nice to get the OK from you).

@dnfield dnfield requested a review from zanderso January 8, 2019 00:22
- prefer_bool_in_asserts
- prefer_collection_literals
- prefer_conditional_assignment
- prefer_const_constructors
Copy link
Contributor

Choose a reason for hiding this comment

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

ideally we'd find a way to make this file always exactly the same as the version in the flutter/flutter repo

Copy link
Contributor

Choose a reason for hiding this comment

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

I imagine a lot of projects would want that functionality -- "start with this canonical analysis options file, then override it with the following options"

Perhaps the analyzer could beef up its include directive to support not only relative paths, but also an enumerated set of SDKs? In this world, we'd move the canonical analysis options that currently live in the flutter repo into the Dart SDK as the "flutter analysis options", then the flutter repo would just say "I use Flutter's options"...

/cc @pq

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Somewhat like clang-format use chromium style?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would like that too - I usually start a new Flutter project by copying the Flutter repo's analysis_options

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That has landed - pulling it in to this will require a bunch more changes in the implementation files (get rid of optional new, use = instead of : for parameters, etc.) that would be better to do in a separate PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

sgtm

// found in the LICENSE file.

// ignore_for_file: unused_import,uri_does_not_exist

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd rather we used explicit // ignore on each line rather than ignore_for_file. ignore_for_file makes it very easy to add new problems. If we really want to just turn it off, we can do so in the analysis_options file or using grep -v or some such.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd like to add native_function_body_in_non_sdk_code: ignore to analysis options then - There are a lot of places it gets used, and it would have to be remembered by anyone who adds a native binding method to lib/ui. Thoughts on that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For instance, painting.dart has something like 100 lines that use the native keyword.

sky_engine:
path: ../../../out/host_debug_unopt/gen/dart-pkg/sky_engine
sky_services:
path: ../../../out/host_debug_unopt/gen/dart-pkg/sky_services
Copy link
Contributor

Choose a reason for hiding this comment

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

neat

Copy link
Contributor

@mklim mklim left a comment

Choose a reason for hiding this comment

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

LGTM, modulo open comment from @Hixie

@dnfield dnfield mentioned this pull request Jan 8, 2019
@dnfield dnfield requested a review from cbracken January 11, 2019 06:05
lib/ui/ui.dart Outdated
/// This library exposes the lowest-level services that Flutter frameworks use
/// to bootstrap applications, such as classes for driving the input, graphics
/// text, layout, and rendering subsystems.
Copy link
Contributor

Choose a reason for hiding this comment

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

extraneous blank line

Copy link
Contributor

Choose a reason for hiding this comment

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

(the dartdocs here apply to the library keyword)

@dnfield dnfield merged commit 6179ac6 into flutter:master Jan 11, 2019
@dnfield dnfield deleted the dart_analysis branch January 11, 2019 21:51
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 11, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 12, 2019
engine-flutter-autoroll added a commit to flutter/flutter that referenced this pull request Jan 12, 2019
flutter/engine@b7f6bf0...35daf14

git log b7f6bf0..35daf14 --no-merges --oneline
35daf14 Roll src/third_party/skia d2fa7e33798c..c334df71b8f9 (45 commits) (flutter/engine#7448)
6179ac6 fix up analysis for Dart in Engine (flutter/engine#7404)
bec12d8 Reland Dart SDK rolls made since 2019/01/08 (flutter/engine#7446)
3f99878 Match the ios number input type behavior to what is said in the docs (flutter/engine#7281)
358a24c Make SetLocales more consistent with other RuntimeController methods (flutter/engine#7447)
0c11836 Use anti-aliasing when drawing text in the performance overlay (flutter/engine#7445)

The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff ([email protected]), and stop
the roller if necessary.
kangwang1988 pushed a commit to XianyuTech/flutter that referenced this pull request Feb 12, 2019
flutter/engine@b7f6bf0...35daf14

git log b7f6bf0..35daf14 --no-merges --oneline
35daf14 Roll src/third_party/skia d2fa7e33798c..c334df71b8f9 (45 commits) (flutter/engine#7448)
6179ac6 fix up analysis for Dart in Engine (flutter/engine#7404)
bec12d8 Reland Dart SDK rolls made since 2019/01/08 (flutter/engine#7446)
3f99878 Match the ios number input type behavior to what is said in the docs (flutter/engine#7281)
358a24c Make SetLocales more consistent with other RuntimeController methods (flutter/engine#7447)
0c11836 Use anti-aliasing when drawing text in the performance overlay (flutter/engine#7445)

The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff ([email protected]), and stop
the roller if necessary.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants