googlearchive / pedantic

How to get the most value from Dart static analysis
https://pub.dev/packages/pedantic
BSD 3-Clause "New" or "Revised" License
324 stars 56 forks source link

Invalid include_file_not_found when pedantic added to dev_dependencies #72

Closed awhitford closed 4 years ago

awhitford commented 4 years ago

After adding pedantic to a project, I am seeing this warning:

warning • The include file package:pedantic/analysis_options.yaml in /Users/anthony/github/awhitford/Animated-Text-Kit/analysis_options.yaml
       cannot be found • analysis_options.yaml:1:11 • include_file_not_found

The analysis_options.yaml is as prescribed:

include: package:pedantic/analysis_options.yaml

Since I am only using pedantic for lints, I added it to dev_dependencies.

Note that the rules seem to be working and I am seeing results from flutter analyze.

However, I noticed that this warning goes away if I move pedantic to dependencies. (But I don't really want to because it should not be necessary.) As a result, this warning looks invalid.

llucax commented 4 years ago

I'm having the same but using include: package:pedantic/analysis_options.1.9.0.yaml:

warning • The include file package:pedantic/analysis_options.1.9.0.yaml in /my/project/analysis_options.yaml cannot be found •
       analysis_options.yaml:1:11 • include_file_not_found

I think this started after a flutter upgrade I just did (on the stable channel).

$ flutter --version
Flutter 1.22.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 84f3d28555 (7 days ago) • 2020-10-15 16:26:19 -0700
Engine • revision b8752bbfff
Tools • Dart 2.10.2
awhitford commented 4 years ago

I too am using 1.22.2:

Flutter 1.22.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 84f3d28555 (8 days ago) • 2020-10-15 16:26:19 -0700
Engine • revision b8752bbfff
Tools • Dart 2.10.2
davidmorgan commented 4 years ago

Not sure what could have changed--maybe dev dependencies are being pulled to somewhere different that the analyzer can't find?

@bwilkerson any ideas please?

awhitford commented 4 years ago

This looks related: https://github.com/dart-lang/sdk/issues/42910

awhitford commented 4 years ago

I figured it out... I needed to add pedantic also to the pubspec.yaml in the example folder. I was getting results from the main package, but when the examples were being processed, that is when the warning emitted.