-
Notifications
You must be signed in to change notification settings - Fork 942
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
Lint shell files with shfmt, fix bash-exec version #642
Conversation
The PR is failing because we don't have an |
Dockerfile
Outdated
################# | ||
# Install shfmt # | ||
################# | ||
ENV GO111MODULE=on |
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 we change this to:
#################
# Install shfmt #
#################
ENV GO111MODULE=on
GOROOT=/usr/lib/go
GOPATH=/go
PATH="$PATH":"$GOROOT"/bin
PATH="$PATH":"$GOPATH"/bin
RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin \
&& go get mvdan.cc/sh/v3/cmd/shfmt
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.
this should create fewer layers and help keep the image in good shape
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.
Done
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.
PS: Had to use a separate instructions for PATH if we want to reuse GOROOT and GOPATH
@ferrarimarco Are you proposing to use a top level Also, do we need to check and load the |
|
Now the build failed for a temporary network failure (I suppose). You might want to restart it and try again. |
@ferrarimarco |
It's already enabled :) |
@admiralAwkbar This is what I meant in my point 3 above: 2020-08-31 16:19:48 [INFO ] ----------------------------------------------
2020-08-31 16:19:48 [INFO ] Testing Codebase [SHELL_SHFMT] files...
2020-08-31 16:19:48 [INFO ] ----------------------------------------------
2020-08-31 16:19:48 [INFO ] ----------------------------------------------
2020-08-31 16:19:48 [INFO ] Successfully found binary for [shfmt] in system location: [/go/bin/shfmt]
2020-08-31 16:19:48 [INFO ] ---------------------------
2020-08-31 16:19:48 [INFO ] File:[/tmp/lint/.automation/test/shell_shfmt/shell_shfmt_bad_1.sh]
2020-08-31 16:19:48 [INFO ] - File:[shell_shfmt_bad_1.sh] failed test case with [shfmt] successfully
2020-08-31 16:19:48 [INFO ] ---------------------------
2020-08-31 16:19:48 [INFO ] File:[/tmp/lint/.automation/test/shell_shfmt/shell_shfmt_good_1.sh]
2020-08-31 16:19:48 [INFO ] - File:[shell_shfmt_good_1.sh] failed test case with [shfmt] successfully
2020-08-31 16:19:49 [WARN ] No TAP expected file found at:[/tmp/lint/.automation/test/shell_shfmt/reports/expected-SHELL_SHFMT.tap]
2020-08-31 16:19:49 [INFO ] skipping report assertions
2020-08-31 16:19:49 [INFO ] ---------------------------------------------- |
Addition to my point 2 above: shfmt can be configured either via |
@ferrarimarco I agree, if the config is not found, then we need to disable and warn the user that it's being skipped. Can you add and merge the master back to it? added some fixes and should be a real blast... |
done! |
Additionally, I've tuned ZSH detection output messages a bit. See my description above |
@ferrarimarco Very nice work! |
Fixes #492
Proposed Changes
Readiness Checklist
Author/Contributor
Reviewing Maintainer
breaking
if this is a large fundamental changeautomation
,bug
,documentation
,enhancement
,infrastructure
, orperformance