Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Skip templating when creating policy file in workspace root. Allow disabling templating. #1141

Closed
anderseknert opened this issue Sep 26, 2024 · 1 comment

Comments

@anderseknert
Copy link
Member

We currently create a "main" directory for this and move it there. This has rightly been perceived as confusing, and there's nothing in this process that provides a clue as to why this happened. We could add a comment or something like that in the template, but a simpler approach is to just skip templating in the workspace root. This will instead flag a violation, giving users a chance to learn about it, and disable it if they so want.

On the topic of disabling, we should also allow disabling templating altogether.

charlieegan3 added a commit to charlieegan3/regal that referenced this issue Oct 3, 2024
This also disables templating for files in the root.

Fixes StyraInc#1164

Related to StyraInc#1141, but this needs
more work

Signed-off-by: Charlie Egan <charlie@styra.com>
charlieegan3 added a commit to charlieegan3/regal that referenced this issue Oct 7, 2024
This also disables templating for files in the root.

Fixes StyraInc#1164

Related to StyraInc#1141, but this needs
more work

Signed-off-by: Charlie Egan <charlie@styra.com>
charlieegan3 added a commit to charlieegan3/regal that referenced this issue Oct 7, 2024
This also disables templating for files in the root.

Fixes StyraInc#1164

Related to StyraInc#1141, but this needs
more work

Signed-off-by: Charlie Egan <charlie@styra.com>
charlieegan3 added a commit that referenced this issue Oct 7, 2024
* lsp/templating: gracefully unknown root

This also disables templating for files in the root.

Fixes #1164

Related to #1141, but this needs
more work

Signed-off-by: Charlie Egan <charlie@styra.com>

* Guard rather than use error control flow

Signed-off-by: Charlie Egan <charlie@styra.com>

* Correct test error message

Signed-off-by: Charlie Egan <charlie@styra.com>

---------

Signed-off-by: Charlie Egan <charlie@styra.com>
charlieegan3 added a commit to charlieegan3/regal that referenced this issue Jan 6, 2025
* lsp/templating: gracefully unknown root

This also disables templating for files in the root.

Fixes StyraInc#1164

Related to StyraInc#1141, but this needs
more work

Signed-off-by: Charlie Egan <charlie@styra.com>

* Guard rather than use error control flow

Signed-off-by: Charlie Egan <charlie@styra.com>

* Correct test error message

Signed-off-by: Charlie Egan <charlie@styra.com>

---------

Signed-off-by: Charlie Egan <charlie@styra.com>
@anderseknert
Copy link
Member Author

I don't think there's much more to be done here. Will you can't disable templating separately, you can always disable the directory-package-mismatch rule.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant