Skip to content

Add a feature for sharing include/exclude lists across commands #73

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

Open
autarch opened this issue Feb 5, 2025 · 1 comment
Open

Add a feature for sharing include/exclude lists across commands #73

autarch opened this issue Feb 5, 2025 · 1 comment

Comments

@autarch
Copy link
Member

autarch commented Feb 5, 2025

It's pretty common to run multiple tools on the same set of files. For example, with JS code you might run prettier and eslint. It'd be nice if there was a way to share these lists across commands. Otherwise if you have a long list you just have to copy it, which is a maintenance hassle.

Here's an idea of the syntax off the top of my head:

[shared.includes]
js = [ "..." ]

[shared.excludes]
js = [ "..." ]

[commands.prettier]
shared-include = "js"
shared-exclude = "js"

[commands.eslint]
shared-include = "js"
shared-exclude = "js"

I think the shared.(include|exclude) bit makes sense. I'm less certain of the shared-(include|exclude) naming. I would also note that these should be strings or arrays of strings, to allow for using multiple shared lists. When these are used, we also want to allow an include or exclude key. I think these would be combined, with the per-command keys coming last in the list, so that they override anything in the shared lists.

@autarch
Copy link
Member Author

autarch commented Feb 23, 2025

I realized there's no reason to separate shared includes and excludes:

[shared]
js = [ "..." ]

Then commands can refer to this for both include and excludes.

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

No branches or pull requests

1 participant