TruCol / Bash-Checkstyle

CI tool to verify some degree of Google Style Guide for Bash compliance.
GNU General Public License v3.0
4 stars 0 forks source link

Difference between short and long argument, and argument usage consistency (From HN). #1

Open a-t-0 opened 2 years ago

a-t-0 commented 2 years ago

This is the first issue parsed from a related Hacker News post.

2 things https://github.com/nickjj would love to see in a checker would be:

Note, the requester is aware it's technically not possible to give a definitive answer here because supporting spaces vs equals comes down to the CLI tool itself. However, one can pick up when you mix the 2 styles and leave it up to the script author to pick a style and stick with it when possible.

nickjj commented 2 years ago

Thanks for moving this over. I know the first one would be tricky to implement too. Not all tools support both styles.

Maybe in both cases this checker could evaluate these patterns on a per command basis? This way it doesn't need to know anything about the tool itself, only the style you've picked is consistent for that command and if there's an edge case where a tool supports long flags but for some reason doesn't have one for a specific flag there would be a way to ignore that flag similar to how you can ignore specific ShellCheck rules -- in this case this checker could let you ignore just that 1 flag.