dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.25k stars 1.58k forks source link

provide analysis errors and warnings of the pubspec.yaml file #30324

Closed devoncarew closed 6 years ago

devoncarew commented 7 years ago

Companion issue here: https://github.com/flutter/flutter-intellij/issues/1259

Specifically, flutter users would get a lot of benefit from validations of the flutter assets section of the pubspec file.

flutter:
  uses-material-design: true
  assets:
    - lib/gallery/example_code.dart
    - packages/flutter_gallery_assets/appbar_background.jpg
    - packages/flutter_gallery_assets/appbar/appbar_background_layer0.png
    - packages/flutter_gallery_assets/appbar/appbar_background_layer1.png
    - packages/flutter_gallery_assets/appbar/appbar_background_layer2.png
    - packages/flutter_gallery_assets/shrine/vendors/sandra-adams.jpg
    - packages/flutter_gallery_assets/shrine/vendors/zach.jpg
  fonts:
    - family: Raleway
      fonts:
        - asset: packages/flutter_gallery_assets/pesto/fonts/Raleway-Regular.ttf
        - asset: packages/flutter_gallery_assets/pesto/fonts/Raleway-Medium.ttf
          weight: 500
        - asset: packages/flutter_gallery_assets/pesto/fonts/Raleway-SemiBold.ttf
          weight: 600
    - family: AbrilFatface
      fonts:
        - asset: packages/flutter_gallery_assets/shrine/fonts/abrilfatface/AbrilFatface-Regular.ttf
bwilkerson commented 6 years ago

This has now been implemented. We should open separate issues if there are additional things we'd like to have validated.

DanTup commented 6 years ago

Is pubspec validation still only on-save? I'm not currently sending overlays during editing of pubspec (I do for analysis_options for some reason though); should I add it in case it's added in future (I guess same goes for if it ever gets completion)?

bwilkerson commented 6 years ago

Is pubspec validation still only on-save?

Yes.

... should I add it in case it's added in future ...

I'm not sure what the priority of this feature is, and it would be a shame for you to spend time implementing a feature that never gets plumbed through. So I'd say no for now.

DanTup commented 6 years ago

It's only adding the filename to an array to support :) That said, since I can't test it and the HTML version returned unwanted errors in latest stable maybe it is best to leave until (or if) implemented.