Skip to content

Conversation

@WalterKolczynski-NOAA
Copy link
Contributor

Description

Updates the ex-scripts to be compliant with both shellcheck and shfmt. This does not necessarily enforce some standards not checked by shellcheck. 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

  • Bug fix (fixes something broken)
  • New feature (adds functionality)
  • Maintenance (code refactor, clean-up, new CI test, etc.)

Change characteristics

  • Is this a breaking change (a change in existing functionality)? NO
  • Does this change require a documentation update? NO
  • Does this change require an update to any of the following submodules? NO

How has this been tested?

  • Full test suite on Ursa

Checklist

  • Any dependent changes have been merged and published
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have documented my code, including function, input, and output descriptions
  • My changes generate no new warnings
  • New and existing tests pass with my changes
  • This change is covered by an existing CI test or a new one has been added
  • Any new scripts have been added to the .github/CODEOWNERS file with owners
  • I have made corresponding changes to the system documentation if necessary

Copy link
Contributor

@JessicaMeixner-NOAA JessicaMeixner-NOAA left a 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.

mv buoy_log.tmp buoy_log.dat

Nb=$(wc buoy_log.dat | awk '{ print $1 }')
Nb=$(wc -l < buoy_log.dat)
Copy link
Contributor

Choose a reason for hiding this comment

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

Was it confirmed that all point output is the same for waves after this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just compared the contents of gfs.t12z.bull.tar, and the contents are identical. Is that sufficient, or do you want me to check all the tarballs?

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we do a quick check on one of the boundary point tar balls as well? That should then be sufficient.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, looks good

Copy link
Contributor

Choose a reason for hiding this comment

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

thanks for checking.

err_exit "MISSING BULLETIN INFO"
fi
echo ' Looping over buoys ...'
echo
Copy link
Contributor

Choose a reason for hiding this comment

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

What's wrong with \n?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't make this change manually. Must be something shfmt does.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Disregard, replied to the wrong comment.

@DavidHuber-NOAA
Copy link
Contributor

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.

@WalterKolczynski-NOAA I think that this comes from the change you made to .editorconfig:
https://github.com/NOAA-EMC/global-workflow/blame/5fa67e3339e300c9d380e32c98dba541948fbfcc/.editorconfig#L25-L38

@JessicaMeixner-NOAA
Copy link
Contributor

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.

@WalterKolczynski-NOAA I think that this comes from the change you made to .editorconfig: https://github.com/NOAA-EMC/global-workflow/blame/5fa67e3339e300c9d380e32c98dba541948fbfcc/.editorconfig#L25-L38

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?

@WalterKolczynski-NOAA
Copy link
Contributor Author

WalterKolczynski-NOAA commented Oct 15, 2025

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.

@WalterKolczynski-NOAA I think that this comes from the change you made to .editorconfig: https://github.com/NOAA-EMC/global-workflow/blame/5fa67e3339e300c9d380e32c98dba541948fbfcc/.editorconfig#L25-L38

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants