-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[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. |
@@ -6,7 +6,7 @@ CONFIG_FILE="../Web-Expensify/_config.local.php" | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@roryabraham adding the quotes broke this. Can we make this work and make the linter happy?
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.
@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.sh
from 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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
filesWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Screenshots/Videos