Skip to content

Commit

Permalink
update golangci-lint tool and fix pretty issue based on commit abf59e0
Browse files Browse the repository at this point in the history
  • Loading branch information
EskoDijk committed Jun 8, 2024
1 parent cdaf257 commit a3c088e
Show file tree
Hide file tree
Showing 4 changed files with 463 additions and 318 deletions.
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
run:
skip-files:
- "web/site/bindata.go"
29 changes: 14 additions & 15 deletions script/pack-web
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright (c) 2020-2023, The OTNS Authors.
# Copyright (c) 2020-2024, The OTNS Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -33,21 +33,20 @@
main()
{
readonly sitedir="$OTNSDIR"/web/site
cd "$sitedir" || return 1
npm install
npm version
npx webpack ./js/visualize.js -o ./static/js/visualize.js
npx webpack ./js/energyViewer.js -o ./static/js/energyViewer.js
npx webpack ./js/statsViewer.js -o ./static/js/statsViewer.js
(
cd "$sitedir"
npm install
npm version
npx webpack ./js/visualize.js -o ./static/js/visualize.js
npx webpack ./js/energyViewer.js -o ./static/js/energyViewer.js
npx webpack ./js/statsViewer.js -o ./static/js/statsViewer.js

go-bindata -pkg web_site -o _bindata.go templates/... static/...
head -26 bindata.go >_merge_bindata.go
cat _bindata.go >>_merge_bindata.go
mv _merge_bindata.go bindata.go
rm -f _bindata.go
golangci-lint run "${GOLINT_ARGS[@]}" --fix bindata.go

cd - || return 1
go-bindata -pkg web_site -o _bindata.go templates/... static/...
head -26 bindata.go >_merge_bindata.go
cat _bindata.go >>_merge_bindata.go
mv _merge_bindata.go bindata.go
rm -f _bindata.go
)
}

./script/compile-proto
Expand Down
4 changes: 2 additions & 2 deletions script/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ install_package()
function install_pretty_tools()
{
if ! installed golangci-lint; then
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "$(go env GOPATH)"/bin v1.50.1
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "$(go env GOPATH)"/bin v1.51.2
fi

install_package shfmt --brew shfmt --snap shfmt
go install mvdan.cc/sh/v3/cmd/shfmt@latest
install_package shellcheck --apt shellcheck --brew shellcheck
}

Expand Down
Loading

0 comments on commit a3c088e

Please sign in to comment.