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

[CLI] Format a file/folder instead of a project #76

Open
jaudiger opened this issue Jul 5, 2024 · 1 comment
Open

[CLI] Format a file/folder instead of a project #76

jaudiger opened this issue Jul 5, 2024 · 1 comment
Labels
good first issue Good for newcomers

Comments

@jaudiger
Copy link
Contributor

jaudiger commented Jul 5, 2024

Usually, formatters take as input a list of files, or folders, or even a glob pattern. It enables granularity and lets the end user choose between formatting a whole folder recursively or just a single file.

The brioche formatter takes another approach, which is to format per project (and without giving any granularity):

Format the Brioche files in a project

Usage: brioche fmt [OPTIONS] --project <PROJECT>

Would it make sense to switch to a file/folder formatter, or should we continue to format per project? The discussion starts here (#75) could also be extended to this issue if the option 2 is chosen.

@kylewlacy
Copy link
Member

I personally like being able to enforce per-project formatting, and there's precedence with cargo fmt at least. But I'm not against supporting both, and I think it should be fairly straightforward to support both by taking a list of positional arguments and --project arguments then figuring out which files and/or projects to format from that. I might suggest disallowing formatting both projects and individual files in a single invocation (since it seems kind of ambiguous to me what should happen in that case) as a starting point, but I'd be open to a contribution for this feature

@kylewlacy kylewlacy added the good first issue Good for newcomers label Jul 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants