mgechev / revive

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

feat: add support for import-alias-naming rule #881

Closed denisvmedia closed 1 year ago

denisvmedia commented 1 year ago

Closes #880.

denisvmedia commented 1 year ago

@chavacava I'm thinking of making it an array of rules instead of a single rule. This will let users submitting multiple regexes that will be combined as logical AND (so that every rule must match). What do you think?

upd: to be clear, the idea is clarity of the configuration. The first regex can be the main, positive, match. Other subsequent regexes may be used to imply negative matches. E.g. to exclude v1 the user will provide a negative match ^(?!v1$).*. However, it is possible to do in a single regex, the readability will suffer, I'm afraid.

chavacava commented 1 year ago

@chavacava I'm thinking of making it an array of rules instead of a single rule. This will let users submitting multiple regexes that will be combined as logical AND (so that every rule must match). What do you think? upd: to be clear, the idea is clarity of the configuration. The first regex can be the main, positive, match. Other subsequent regexes may be used to imply negative matches. E.g. to exclude v1 the user will provide a negative match ^(?!v1$).*. However, it is possible to do in a single regex, the readability will suffer, I'm afraid.

I personally prefer a single argument. That way there is no need to explain (and understand) how multiple regex are combined (AND or OR?). Yes it can lead to a complex regex but... if you are playing with a regex you know what are you doing :)

denisvmedia commented 1 year ago

I personally prefer a single argument. That way there is no need to explain (and understand) how multiple regex are combined (AND or OR?). Yes it can lead to a complex regex but... if you are playing with a regex you know what are you doing :)

OK, let it be a single regex.