Improve format-incremental script#996
Conversation
This is a rewritten version of `check/format-incremental`. This was motivated by the desire to add a `--help` option and do a little bit of cleaning up the code, and then one thing led to another, and, well, here we are. The final changes include: - Added a `--help` option - Added a `--no-color` option - Added a `--quiet` option - Make the script more robust in various ways (e.g., declare variables, be more careful in parsing CLI arguments, etc.) - Don't hard-code ANSI color code sequences in every echo statement - Make the script more DRY - Revise the error & info messages to try to be slightly more clear
|
Is this shared with the other various repos? Is this the first place the updated script will be committed? |
|
my personal rule is once you start using a for loop in a bash script, it's probably time to port it to something like python. Is there someone with more bash expertise who can review this? |
Not yet, but that's my intention. I had to add one for the unitary repo, took the opportunity to rewrite it, and now am going around to add it to the other repos.
It's in a PR for here and unitary at the momment.
I think what I hear you saying is that it's become too complicated. OK, I worked on simplifying it just now and will push an update. @pavoljuhas is more expert in Bash than me, so he's the only other one I can think of. I'll add him to the reviewers. |
|
@mpharrigan The latest commit has a simplified version of the code. |
|
Thanks @mhucka ! It would be nice if @pavoljuhas could give a thorough review so we can port this to all the repos with confidence |
This is a rewritten version of
check/format-incremental. This was motivated by the desire to add a--helpoption and do a little bit of cleaning up the code, and then one thing led to another, and, well, here we are. The final changes include:--helpoption--no-coloroption--quietoption