You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow naming-convention rule to take list of names (not only a pattern) (#1911)
While the title of this PR is what we'll want in the release notes, this is 95% an
internal change meant to improve Regal for ourselves. That a custom rule got better
is mostly a happy coincidence :)
Since we started working on Regal, we have learnt a lot about both OPA, the AST and
of course our own domains — static analysis, linting and language servers. The
terminology used in the project has grown organically along with that, and with time
we've found a shared vocabulary for the project. As a mature project, there's however
been no lack of code written before we knew better, and as this PR highlights there
have been many places where names have been picked rather arbitrarly.
Additionally, the lack of a documented vocabulary meant it wasn't accessible outside
of our own internal know-how.
This change aims to fix that by:
1. Documenting the terminlogy and vocabulary of Regal and our domain
2. Provide the means to help check how well we follow our stated naming conventions
3. Update our Rego code to comply with these naming conventions
While having this goes a long way to unify our terminology, there are things
that won't be caught by a simple "allow list" like this. As an example, our use
of the name `ref` sometimes mean the "outer" type (the ref term), and sometimes
it refers to only the the term slice of the ref (which should rather be called
`terms`). That's out of scope for this PR, but could be something to look into
later.
As noted in the change, we will not enforce anything related to naming conventions,
but occasionally check this and make fixes accordingly (and without ever getting in
the way of anyone contributing to the project).
Fixes#1493
Signed-off-by: Anders Eknert <anders.eknert@apple.com>
0 commit comments