Comments (11)
Is use_super_parameters
enabled for this code? I'm asking in order to determine whether the lint ought to be produced in the IDE but isn't, or whether it ought to not be produced on the bots.
from sdk.
Yes it is. We use package:flutter_lints, which is built on top of package:lints, which includes use_super_parameters
: https://github.com/dart-lang/lints/blob/main/lib/recommended.yaml#L67
from sdk.
@kenzieschmoll are you able to get back to a state where this doesn't show up? I tried checking out latest code and reverting the change in flutter/devtools@25f0133 but it did show up for me:
If you can repro and provide a git hash (or git hash I can apply that change to) and exact SDK version I can debug.
from sdk.
Ignore that - I hadn't synced the Flutter SDK to the same version - it does repro now I'm on the same version.
from sdk.
Ok, so user_super_parameters
was only added to flutter_lints in 3.0.0:
https://pub.dev/packages/flutter_lints/changelog#300
devtools_app is using v3.x:
But it's importing analysis_options from the parent folder which has its own pubspec that is using v2.x:
So my guess is that something changed recently (maybe related to the context changes?) that is causing v2 of flutter_lints to be used now for devtools_app where before, v3 was being used?
A quick fix for DevTools is to update flutter_lints
in the parent pubspec.yaml
alongside the analysis_options.yaml
that's importing that file (it's probably an accident that it has an older version), but I think there might still be some bug here @bwilkerson?
from sdk.
I'm not sure I'm understanding the situation well enough to comment, but in case it's useful information, the expected behavior is for the resolution of URIs on the include
line to always be based on the package configuration of the package in which the initial analysis options file is found, no matter where the analysis options file is found.
In other words, I would expect the resolution of flutter_lints
to differ in the IDE and on the command line only if the package configuration being used differed in those two cases.
from sdk.
On the CI build here, analyze
was run directly inside the devtools_app
sub-folder:
/home/runner/work/devtools/devtools/packages/devtools_app > /home/runner/work/devtools/devtools/tool/flutter-sdk/bin/dart analyze --fatal-infos
Analyzing devtools_app...
info - lib/src/shared/common_widgets.dart:1520:3 - Convert 'context' to a super parameter. - use_super_parameters
This (correctly IMO) flagged the issue.
However when I open the parent folder in VS Code, it seems like it might be using the version specified in the outer folder (at least, that's me theory for why it doesn't show up, since changing the version seemed to fix it). I'll make a small repro.
from sdk.
Here's a repro:
https://github.com/DanTup/repro-dart-sdk-55732
If I open the repository root, there is a nested folder "foo_package" which seems like it should trigger the lint (because it references v3 of flutter_lints), however it seems to be using flutter_lints v2 which is what is defined in the parent folders pubspec.yaml.
I suspect it's because of the import of anlaysis_options going through the parent folder. I tried removing that and it seemed to still be broken, however after restart VS Code the lint triggered again, so I think going through the outer analysis_options.yaml is relevant to the issue.
from sdk.
Just to clarify, the analyzer doesn't look for pubspec.yaml
files, it looks for package_config.json
files when deciding how to resolve URIs. I can't tell from the checked in example where pub
had been run.
from sdk.
Oops, I didn't include them. I've pushed them now - but pub
had been run in both folders and the innermost one does resolve to the correct version (v3) of flutter_lints
.
There are two contexts created and the nested one shows both analysis options like this:
from sdk.
Ok, thanks. Then what I would expect, assuming that there weren't any flags on the command line that override the normal lookup, is that everything in foo_package
would use the lints enabled in flutter_lints-3.0.2
when analyzed in either the IDE or from the command-line.
Given that that's not what we're seeing, it does look like a bug.
from sdk.
Related Issues (20)
- SocketException: Connection reset by peer (OS Error: Connection reset by peer) HOT 3
- Analyzer Feedback from IntelliJ
- Analyser falsely reports unused function
- Building app for Linux musl? HOT 2
- MSAN use-of-uninitialized-value in FFI tests HOT 1
- Track macro dependencies at the library level for improved invalidation HOT 8
- The SDK configured in dart.flutterSdkPath is not a valid SDK folder. HOT 1
- [breaking change] Change `SecurityContext` to an `abstract final class` HOT 4
- Unhandled Exception: type '_Type' is not a subtype of type 'IBaseModel' in type cast HOT 2
- `Thread 1 is not paused` error at the end of a web test HOT 7
- textDocument/completion payload sizes can be very large because of documentation of in-scope items HOT 7
- Dart cannot open a socket on Android device, not simulator HOT 6
- stdin stream closes unexpectedly when Dart program is spawned from a bat file (which is spawned by a NodeJS process) and an msys2 program has been run earlier in the bat file HOT 1
- vm/cc/DartAPI_BreakpointLockRace flaky -> Timeout on vm-linux-debug-x64c HOT 1
- Crash on new ffi/msan_test on ARM64 MSAN configurations
- Set-Cookie path should not be case-insensitive
- Provide a compatible method to conditionally import between WASM and regular Web with also backward compatibility HOT 5
- [resource_identifiers] closures out of static functions
- pkg/json breaks when a field name contains $ HOT 2
- [vm/ffi] `Pointer.asTypedList` shared across isolates causes use after free
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sdk.