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

Ignore rules in yaml config #42

Closed pd4d10 closed 4 years ago

pd4d10 commented 4 years ago
include: package:pedantic/analysis_options.yaml

linter:
  rules:
    - camel_case_types

This would add camel_case_types rule.

Is there any way to ignore some rules?

a14n commented 4 years ago

You should be able to disable a lint with a : false

include: package:pedantic/analysis_options.yaml

linter:
  rules:
    - camel_case_types: false

See https://dart.dev/guides/language/analysis-options#disabling-individual-rules

pd4d10 commented 4 years ago

Thanks!

pd4d10 commented 4 years ago

Seems we should remove the - before items:

include: package:pedantic/analysis_options.yaml

linter:
  rules:
    camel_case_types: false
Tokenyet commented 4 years ago

That's strange, - should be valid in yaml, but remove - did work for me, too. I just confused with why flutter's analysis_options.yaml is working, or It should work without -.

Here is my enviroment:

[√] Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [Version 10.0.18362.592], locale zh-TW)

[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[√] Android Studio (version 3.5)
[√] VS Code, 64-bit edition (version 1.41.1)
[!] Connected device
    ! No devices available
pedantic: ^1.8.0+1