[No QA] Lint bash scripts with shellcheck#13387
Conversation
|
@marcaaron Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
Looking at this now. |
|
I'm not sure if this means the tests are passing or not... @roryabraham can you please advise? This happens for me while executing step 1 |
|
Oh, @marcaaron that looks like a failure, but I don't have anything in I think probably the best solution then would be to just ignore the |
|
I don't even know what a husky is or how it got on my computer 🐶 |
|
Last step failed for me: |
|
@marcaaron I think that last step failure you were seeing is probably because node modules were not installed inside the VM. The whole point of that last step was to ensure that this script works on Linux (so that we know it will also work in the GitHub Actions runner). Given that we can see it working correctly in an ubuntu here, we are safe to remove that testing step. |
|
Removed that last failing test step since it wasn't needed and also made it more obvious how to add more directories to ignore in the future by moving them into an array. |
Reviewer Checklist
Screenshots/VideosWebMobile Web - ChromeMobile Web - SafariDesktopiOSAndroid |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
| if [ -f ".env" ]; then | ||
| # Export vars from the .env file to access the $EXPENSIFY_URL | ||
| export $(grep -v '^#' .env | xargs) | ||
| export "$(grep -v '^#' .env | xargs)" |
There was a problem hiding this comment.
@roryabraham adding the quotes broke this. Can we make this work and make the linter happy?
There was a problem hiding this comment.
@neil-marcellini Sorry about that ... created a PR here that should fix it. It's a bit more verbose but in my opinion also a bit clearer what it's doing. We can clean up and merge that PR or remove the quotes and suppress the warning. I'm good with either approach.
|
🚀 Deployed to production by @chiragsalian in version: 1.2.38-6 🚀
|

Details
This PR sets up a linter for bash scripts (using ShellCheck, which we also use for other repos such as Ops-Configs) to avoid common errors and help promote a more consistent bash style.
Fixed Issues
$ n/a
Tests
npm run shellcheck– the tests should pass.npm run shellcheck– the tests should fail.npm run shellcheck– the tests should pass../scripts/shellCheck.shfrom the root, and it should pass.cd scripts && ./shellCheck.sh && cd .., the tests should pass.cd .github && ../scripts/shellCheck.sh && cd .., the tests should pass.Offline tests
None.
QA Steps
None
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*filesWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)Avataris modified, I verified thatAvataris working as expected in all cases)Screenshots/Videos