Option to be happy with no inputs collected #1160
Replies: 2 comments 2 replies
-
|
Thanks for the laying out the idea! I appreciate the detail and motivating case. I think my main concern with a "no error on no inputs" type flag is that it can be a footgun for unsuspecting users. Two scenarios off the top of my head:
More philosophically, I think I'm wary of flags that turn commands into no-ops: they're essentially a way to push control flow into a program, when often the clearer thing is to write control flow around a program. With that said, the scenario you're describing is a tough one -- I hadn't really considered that people would only want to run Thinking laterally: running |
Beta Was this translation helpful? Give feedback.
-
|
#1515 should address this! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
In general, I think a non-zero exit on "no inputs collected" is good. However, there may be use cases where that's not desirable. For example, $dayjob has a tool that examines pull requests and runs zizmor if there are files changed in
.github/workflows. But sometimes those files aren't actual workflow files, they're something else. We've changed it to explicitly look for*y{,a}mlbut even then, I think it's possible that a yaml file exists that isn't parsed as a GitHub worfklow.So! I thought it might be good to have an option for a happy (0) exit in that case.
--no-inputs-is-fine-actually(I'm workshopping the name still) would be false by default, but give users the option to not care in cases where they might not actually care. The downside is that it would mean zizmor doesn't catch files that can't be parsed because they're invalid (I think), but for some users, that might be preferable to zizmor giving an unclean exit.I'm happy to contribute this if it seems useful, but I wanted to bring up the idea before I started doing the work. :-)
Beta Was this translation helpful? Give feedback.
All reactions