good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
websocket
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
github
nhooyr
websocket
Commits
5f3fa5c7
Unverified
Commit
5f3fa5c7
authored
Feb 16, 2020
by
Anmol Sethi
Browse files
Options
Downloads
Patches
Plain Diff
Add shfmt and shellcheck
parent
e7e4b516
No related branches found
No related tags found
No related merge requests found
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
Makefile
+0
-6
0 additions, 6 deletions
Makefile
ci/ensure_fmt.sh
+23
-0
23 additions, 0 deletions
ci/ensure_fmt.sh
ci/fmt.mk
+5
-8
5 additions, 8 deletions
ci/fmt.mk
ci/image/Dockerfile
+4
-2
4 additions, 2 deletions
ci/image/Dockerfile
ci/lint.mk
+4
-1
4 additions, 1 deletion
ci/lint.mk
with
36 additions
and
17 deletions
Makefile
+
0
−
6
View file @
5f3fa5c7
...
@@ -2,12 +2,6 @@ all: fmt lint test
...
@@ -2,12 +2,6 @@ all: fmt lint test
.SILENT
:
.SILENT
:
.PHONY
:
*
.ONESHELL
:
SHELL
=
bash
.SHELLFLAGS
=
-ceuo
pipefail
include
ci/fmt.mk
include
ci/fmt.mk
include
ci/lint.mk
include
ci/lint.mk
include
ci/test.mk
include
ci/test.mk
This diff is collapsed.
Click to expand it.
ci/ensure_fmt.sh
0 → 100755
+
23
−
0
View file @
5f3fa5c7
#!/usr/bin/env bash
set
-euo
pipefail
main
()
{
local
files
mapfile
-t
files < <
(
git ls-files
--other
--modified
--exclude-standard
)
if
[[
${
files
[*]
}
==
""
]]
;
then
return
fi
echo
"Files need generation or are formatted incorrectly:"
for
f
in
"
${
files
[@]
}
"
;
do
echo
"
$f
"
done
echo
echo
"Please run the following locally:"
echo
" make fmt"
exit
1
}
main
"
$@
"
This diff is collapsed.
Click to expand it.
ci/fmt.mk
+
5
−
8
View file @
5f3fa5c7
fmt
:
modtidy gofmt goimports prettier
fmt
:
modtidy gofmt goimports prettier
shfmt
ifdef
CI
ifdef
CI
if
[[
$$(
git ls-files
--other
--modified
--exclude-standard
)
!=
""
]]
;
then
./ci/ensure_fmt.sh
echo
"Files need generation or are formatted incorrectly:"
git
-c
color.ui
=
always status |
grep
--color
=
no
'\e\[31m'
echo
"Please run the following locally:"
echo
" make fmt"
exit
1
fi
endif
endif
modtidy
:
gen
modtidy
:
gen
...
@@ -23,3 +17,6 @@ prettier:
...
@@ -23,3 +17,6 @@ prettier:
gen
:
gen
:
stringer
-type
=
opcode,MessageType,StatusCode
-output
=
stringer.go
stringer
-type
=
opcode,MessageType,StatusCode
-output
=
stringer.go
shfmt
:
shfmt
-i
2
-w
-s
-sr
$$(
git ls-files
"*.sh"
)
This diff is collapsed.
Click to expand it.
ci/image/Dockerfile
+
4
−
2
View file @
5f3fa5c7
FROM
golang:1
FROM
golang:1
RUN
apt-get update
RUN
apt-get update
RUN
apt-get
install
-y
chromium npm
RUN
apt-get
install
-y
chromium npm shellcheck
ARG
SHFMT_URL=https://github.com/mvdan/sh/releases/download/v3.0.1/shfmt_v3.0.1_linux_amd64
RUN
curl
-L
$SHFMT_URL
>
/usr/local/bin/shfmt
&&
chmod
+x /usr/local/bin/shfmt
ENV
GOFLAGS="-mod=readonly"
ENV
GOFLAGS="-mod=readonly"
ENV
PAGER=cat
ENV
CI=true
ENV
CI=true
ENV
MAKEFLAGS="--jobs=16 --output-sync=target"
ENV
MAKEFLAGS="--jobs=16 --output-sync=target"
...
...
This diff is collapsed.
Click to expand it.
ci/lint.mk
+
4
−
1
View file @
5f3fa5c7
lint
:
govet golint
lint
:
govet golint
govet-wasm golint-wasm shellcheck
govet
:
govet
:
go vet ./...
go vet ./...
...
@@ -11,3 +11,6 @@ golint:
...
@@ -11,3 +11,6 @@ golint:
golint-wasm
:
golint-wasm
:
GOOS
=
js
GOARCH
=
wasm golint
-set_exit_status
./...
GOOS
=
js
GOARCH
=
wasm golint
-set_exit_status
./...
shellcheck
:
shellcheck
$$(
git ls-files
"*.sh"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment