FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
shellhub/devscripts/lint-code at master · shellhub-io/shellhub · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
shellhub-io
/
shellhub
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
188
Star
2.1k
Code
Issues
11
Pull requests
11
Discussions
Actions
Wiki
Security and quality
5
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
shellhub
/
devscripts
/
lint-code
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
72 lines (56 loc) · 1.45 KB
Breadcrumbs
shellhub
/
devscripts
/
lint-code
Copy path
File metadata and controls
executable file
·
72 lines (56 loc) · 1.45 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!
/bin/sh
usage
() {
cat
<<
EOF
Run code lints under development machine.
Usage:
$0
<mode> [--fix]
Mode:
go Run golang lint utilities
all Run all lint utilities
EOF
exit
1
}
go
() {
local
fix=
$1
[
"
$fix
"
=
"
true
"
]
&&
EXTRA_ARGS=
"
--fix
"
||
EXTRA_ARGS=
"
"
[
!
-e
.golangci.yaml ]
&&
echo
"
ERROR: Run the script from the project root.
"
&&
exit
1
for
container
in
agent:docker agent:native server
;
do
echo
"
Running Golang linter on
$container
"
case
$container
in
agent:docker)
EXTRA_ARGS=
"
$EXTRA_ARGS
--build-tags docker
"
container=
$(
echo
$container
|
cut -d
'
:
'
-f 1
)
;;
agent:native)
EXTRA_ARGS=
"
$EXTRA_ARGS
--build-tags native
"
container=
$(
echo
$container
|
cut -d
'
:
'
-f 1
)
;;
esac
#
Run golangci-lint on a running container
docker-compose \
-f docker-compose.yml -f docker-compose.dev.yml \
exec
$container
golangci-lint run ./...
$EXTRA_ARGS
done
echo
"
Running Golang linter on pkg
"
docker-compose \
-f docker-compose.yml -f docker-compose.dev.yml \
exec
server sh -c
"
(cd ../pkg; golangci-lint run
$EXTRA_ARGS
./... )
"
}
mode=
$1
arg=
$2
case
"
$arg
"
in
"
--fix
"
)
fix=
"
true
"
;;
esac
case
"
$mode
"
in
"
go
"
)
go
$fix
;;
"
all
"
)
go
$fix
;;
*
)
usage
;;
esac
Back
|
FazBrowse Home
|
New Git URL