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

feat: accept multiple arguments as inputs #104

Merged
merged 3 commits into from
Nov 3, 2024
Merged

feat: accept multiple arguments as inputs #104

merged 3 commits into from
Nov 3, 2024

Conversation

miketheman
Copy link
Collaborator

Accept multiple individual files as inputs.
Useful with other mutli-file processing like xargs or other tools, so as to not have to invoke zizmor multiple times, and distinct from operating on an entire directory.

@miketheman miketheman added enhancement New feature or request cli labels Nov 2, 2024
@miketheman miketheman requested a review from woodruffw November 2, 2024 21:57
@miketheman
Copy link
Collaborator Author

Easier to review ignoring whitespace: https://github.com/woodruffw/zizmor/pull/104/files?w=1

Accept multiple individual files as inputs.
Useful with other mutli-file processing like xargs or other tools, so
as to not have to invoke zizmor multiple times, and distinct from
operating on an entire directory.

Signed-off-by: Mike Fiedler <[email protected]>
Copy link
Owner

@woodruffw woodruffw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @miketheman!

@woodruffw woodruffw merged commit 2faf309 into main Nov 3, 2024
4 checks passed
@woodruffw woodruffw deleted the variadic-args branch November 3, 2024 15:08
@woodruffw
Copy link
Owner

I thought a bit about this, and I think it might make sense to restrict the inputs slightly (but not as much as they were before).

Concretely, instead of <dir | file> [dir | file] ..., I'm thinking <dir | file [file ...]> so that there's only ever one directory at most, but the user can still pass in multiple files explicitly if they please.

My rationale for this is that it'll make config (#12) discover a little easier: with just one directory, there's only one place where the config needs to be discovered.

Thoughts @miketheman?

@woodruffw
Copy link
Owner

I thought about this more, and I'm probably overcomplicating it. For now I'll do autodiscovery via ${CWD} and also support a --config flag; the rest can come later if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants