dart-code-checker/dart-code-metrics

[Rule change] `no-magic-numbers`, ignore constructor defaults.

velia-vito opened this issue · 0 comments

What rule do you want to change?

no-magic-numbers

What change to do you want to make?

Generate fewer warnings

How do you think the change should be implemented?

A new default behavior

Example code

MekuPalette(
    Color seedColor, [
    double baseColorBrightness = 0.1,
    double colorBrightnessIncrement = 0.2,
  ]) { ...

What does the rule currently do for this code?

Sometimes methods have arbitrary defaults. The rule currently shows up as a warning for all said deafult values.

What will the rule do after it's changed?

Ignore method default values i.e. magic constants within [...]

Participation

  • I am willing to submit a pull request to implement this change.

Additional comments

No response