StyraInc / regal

Regal is a linter and language server for Rego, bringing your policy development experience to the next level!
https://docs.styra.com/regal
Apache License 2.0
253 stars 34 forks source link

Move `external-reference` to `custom` category #1002

Open anderseknert opened 1 month ago

anderseknert commented 1 month ago

This is by far the rule we've had to make the most exceptions for in Regal, and we've heard from a few others that this has been a tad too pedandtic. While users can easily disable the rule, I think it makes sense that those who want this will have to enable it instead. Move this rule to the custom category, and make sure all references are updated.

It would be good if we can somehow allow users who have explicitly enabled this in their configuration to have it remain working without changes. Let's see if that's possible.

anderseknert commented 3 weeks ago

OK, so having thought about this for some time — instead of moving this to the custom category, where likely few will notice or use this.. How about we change this rule to flag excessive use of external references in functions, where the value of "excessive" is configurable? And would default to something like 2-3? I do feel that anything more than that is a good occasion to consider your design, and I do think we should emphasize the main point of using functions (as opposed to rules) is that they allow dependencies to be passed as args.