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.24k stars 1.57k forks source link

Make sure analyzer bots catch lints and implicit downcasts configured through analysis_options.yaml #41651

Open stereotype441 opened 4 years ago

stereotype441 commented 4 years ago

Today I had to fix an implicit downcast error that I accidentally introduced (https://dart-review.googlesource.com/c/sdk/+/144780). For some reason, neither the trybots nor the post-commit bots caught this error. I haven't investigated deeply, but I suspect that the bots are running the analyzer in a way that somehow prevents it from noticing the implicit_downcasts setting in the nnbd_migration package's analysis_options.yaml file.

@bwilkerson has noticed a similar issue with lint failures--they are getting committed without breaking any bots. Since lints are configured using analysis_options.yaml, it's possible that this issue has the same root cause.

srawlins commented 2 years ago

The new strict-casts: true analysis option has landed, I can look into how much work it is to enable it for package:analyzer and package:nnbd_migration.