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

[style] update analyzer options to the recommended lint set #48784

Open pq opened 2 years ago

pq commented 2 years ago

Transitioning from pedantic to recommended lints there are a number of lints disabled that need vetting.

asashour commented 2 years ago

I hope it is fine to raise those CLs here. As recently mentioned, returns types should be declared.

This CL declares the return type of main(), it was done using IDE replacement (only main() { at line beginning of line):

https://dart-review.googlesource.com/c/sdk/+/257340

Async main() and some analysis_server functions: https://dart-review.googlesource.com/c/sdk/+/257342

The test methods https://dart-review.googlesource.com/c/sdk/+/257343

bwilkerson commented 2 years ago

This issue appears to be a request to decide which of the listed lints we should enforce in the analyzer packages. I think we should make those decisions before we attempt to enforce the lints.

That said, the CLs above appear to be enforcing type_annotate_public_apis, which isn't on the list. While I believe that we should enable that lint (we follow it 90+% of the time, and consistency in this area would be a good thing imo), that also hasn't been decided.

asashour commented 2 years ago

The CLs lint is more of always_declare_return_types (which is not on the list), and it was hinted few times during reviews.

The CLs are split mainly for main() and for test_ methods.

pq commented 2 years ago

This issue appears to be a request to decide which of the listed lints we should enforce in the analyzer packages.

Also FYI @devoncarew who is in conversations about defining (and enforcing) a dart team lint set (which may or may not derive from the current recommended rules).

devoncarew commented 2 years ago

FWIW, a dart team rule set - once defined - would definitely be strict super-set of package:lints/recommended.yaml.