Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Allow custom templating for newly created files #1066

Open
anderseknert opened this issue Sep 5, 2024 · 0 comments
Open

Allow custom templating for newly created files #1066

anderseknert opened this issue Sep 5, 2024 · 0 comments

Comments

@anderseknert
Copy link
Member

Since we're now in the business of templating too 😄

When a new file is created, and we currently add:

package inferred.from.path

import rego.v1

It'd be kinda cool if we'd allow users to customize this with their own templates, in .regal/templates or whatever. So that for each new file created, you'd be able to get things like metadata annotations on the package, tests that import the package they're testing, the common library used everywhere, and whatever else we think could be useful. For templating, I'd imagine we'd provide some useful variables that they could inject, like the package name, bundle data, regal config and so on.

We should also make it so that it's possible to create files from template not just from the language server, but from something like the regal new command too.

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

No branches or pull requests

1 participant