-
Notifications
You must be signed in to change notification settings - Fork 204
Update bash ex-scripts to be linter compliant #4151
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
base: develop
Are you sure you want to change the base?
Update bash ex-scripts to be linter compliant #4151
Conversation
Exports variables reported by shellcheck as being unused. A more careful examination is needed to remove unnecessary variables.
JessicaMeixner-NOAA
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can someone point me to where 4 spaces instead of 2 is the standard for the g-w or some linter check? I was unaware that was a thing, since 2 spaces is very widely used across the g-w.
This PR needs to be tested on WCOSS2 to ensure that all wave AWIPS, etc jobs are still running as expected as this changes those scripts and I think most of the changes were spaces, but I'm still going through to confirm as github isn't showing all of them as such. Additionally, wave jobs should be checked that the contents is the same before and after this PR as there were a few places where commands were changed.
@WalterKolczynski-NOAA I think that this comes from the change you made to .editorconfig: |
So this is a new thing. This even seems inconsistent in .editorconfig as well. Is .editorconfig where we should be looking for these sorts of standards in the future? |
Yes. I will note before this point, no standard was enforced for bash scripts, which is why different scripts had different indentation. This PR is part of applying a standard to all the legacy scripts so enforcement can begin. Four spaces is a compromise between space usage and visibility, and is consistent with the python scripts. |
|
Gaea C6 Runner was of line this morning and I didn't get it back until this evening (working remotely in other time zone) it is running now. |
|
@DavidHuber-NOAA The rebuild on Gaea C6 for this PR had some inexplicable errors (I have not pursued this yet -- see below) While the restart from the nightly worked fine. We'll see in the morning after the nightly runs again. |
aerorahul
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
|
@TerrenceMcGuinness-NOAA I recall these GraphQL errors coming up before. It required an updated github-cli IIRC. I'm going to go ahead and launch this on C6 manually. |
|
Ursa passed on the second run through, so I suspect the |
What |
@WalterKolczynski-NOAA Yes, this was your suggestion to an issue I raised: #4151 (comment) |
Turns on the bash option to allow null globs in loops rather than treating `*` as a literal.
Ah. Find wasn't showing it for some reason. Change made. Put in preamble for want of a better location. |
|
Great, thanks @WalterKolczynski-NOAA! I'll start up testing on C6. |
Description
Updates the ex-scripts to be compliant with both
shellcheckandshfmt. This does not necessarily enforce some standards not checked byshellcheck. Export statements are added to some variables to avoid 'not used' errors. In the future, a more careful analysis should be done to see if these variables are used downstream by executables or if they are truly unused, in which case they should be removed.Scripts employing MPMD are also updated to use
run_mpmd.sh. This resulted in some retooling of those scripts.Refs: #397
Type of change
Change characteristics
How has this been tested?
Checklist