mgechev / revive

🔥 ~6x faster, stricter, configurable, extensible, and beautiful drop-in replacement for golint
https://revive.run
MIT License
4.79k stars 278 forks source link

Opposite of increment-decrement (for non-loop-counter usage) #910

Open scop opened 1 year ago

scop commented 1 year ago

Is your feature request related to a problem? Please describe.

The increment-decrement rule is quite opinionated, as many rules are. However, its suggestion is problematic in the sense that e.g.

Describe the solution you'd like

increment-decrement can be disabled like all others, no problem with that, and that does not require a solution.

But for the above reasons, a rule that would do the opposite of increment-decrement for anything but loop counters would be nice to have.

Describe alternatives you've considered

Just disabling increment-decrement, but that won't help with adoption of the += 1 style.

Additional context

N/A.

chavacava commented 1 year ago

Hi @scop, thank you for the proposal. PR are welcome.