mgechev / revive

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

per-rule file exclude filters (#850) #857

Closed comdiv closed 1 year ago

comdiv commented 1 year ago

Rule-level file exclude filter feature implementation #850

Tryed to keep project at max compatibility level.

But where are some changes in core structures.

Filters are prechecked and initialized after reading from TOML, so it could cause error. So Initialize() error method added to RuleConfig

Logically it should be applyed in normalize... part of GetConfig, but just parse can return error, not normalize, so added call of initialization to parse part of GetConfig

All tested.

Closes #850

chavacava commented 1 year ago

Hi @comdiv, thanks for the PR ! (I've modified the semantics of the ""exclusion pattern to match nothing )

comdiv commented 1 year ago

Hi @comdiv, thanks for the PR ! (I've modified the semantics of the ""exclusion pattern to match nothing )

OK, it's well semantic too.