You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ha...@apache.org on 2022/06/13 06:11:17 UTC
[skywalking-banyandb] branch chores created (now 2d5b8b5)
This is an automated email from the ASF dual-hosted git repository.
hanahmily pushed a change to branch chores
in repository https://gitbox.apache.org/repos/asf/skywalking-banyandb.git
at 2d5b8b5 Do some chores
This branch includes the following new commits:
new 2d5b8b5 Do some chores
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[skywalking-banyandb] 01/01: Do some chores
Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hanahmily pushed a commit to branch chores
in repository https://gitbox.apache.org/repos/asf/skywalking-banyandb.git
commit 2d5b8b524b3ff19e099f020a80e68b100f7b6c7c
Author: Gao Hongtao <ha...@gmail.com>
AuthorDate: Mon Jun 13 06:05:14 2022 +0000
Do some chores
* Introduce more strict checkers
* Replace yarn with npm
* Add node version checker
* Bump up skywalking-eye
Signed-off-by: Gao Hongtao <ha...@gmail.com>
---
.github/workflows/e2e.storage.yml | 2 -
.github/workflows/go.yml | 6 -
.github/workflows/publish-docker.yml | 2 -
.golangci.yml | 115 +++++++++++++++++
.licenserc.yaml | 3 +-
Makefile | 1 +
api/Makefile | 2 +
api/common/id.go | 8 +-
banyand/Makefile | 3 +
bydbctl/internal/cmd/root.go | 1 +
bydbctl/internal/cmd/root_test.go | 1 -
golangci.yml => desperated-golangci.yml | 3 -
dist/LICENSE | 143 +++++++++++----------
dist/licenses/ui-licenses/license-bindings.txt | 22 ++++
.../ui-licenses/license-file-uri-to-path.txt | 20 +++
dist/licenses/ui-licenses/license-nan.txt | 9 ++
pkg/Makefile | 3 +
revive.toml | 40 ++++++
scripts/build/license.mk | 2 +-
scripts/build/lint.mk | 13 +-
ui/.gitignore | 1 -
ui/.licenserc.yaml | 2 +-
ui/.node-version | 1 +
ui/LICENSE | 5 +-
ui/Makefile | 14 +-
ui/README.md | 16 ++-
ui/tools/checkversion.js | 32 +++++
27 files changed, 363 insertions(+), 107 deletions(-)
diff --git a/.github/workflows/e2e.storage.yml b/.github/workflows/e2e.storage.yml
index 6aa80d4..3e37d80 100644
--- a/.github/workflows/e2e.storage.yml
+++ b/.github/workflows/e2e.storage.yml
@@ -52,8 +52,6 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 16.15
- - name: Install yarn
- run: corepack enable
- name: Install Go
uses: actions/setup-go@v2
with:
diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml
index 07adf88..8ab8e18 100644
--- a/.github/workflows/go.yml
+++ b/.github/workflows/go.yml
@@ -30,8 +30,6 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 16.15
- - name: Install yarn
- run: corepack enable
- name: Install Go
uses: actions/setup-go@v2
with:
@@ -67,8 +65,6 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 16.15
- - name: Install yarn
- run: corepack enable
- name: Install Go
uses: actions/setup-go@v2
with:
@@ -103,8 +99,6 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 16.15
- - name: Install yarn
- run: corepack enable
- name: Install Go
uses: actions/setup-go@v2
with:
diff --git a/.github/workflows/publish-docker.yml b/.github/workflows/publish-docker.yml
index b567864..6a9f657 100644
--- a/.github/workflows/publish-docker.yml
+++ b/.github/workflows/publish-docker.yml
@@ -41,8 +41,6 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 16.15
- - name: Install yarn
- run: corepack enable
- name: Install Go
uses: actions/setup-go@v2
with:
diff --git a/.golangci.yml b/.golangci.yml
new file mode 100644
index 0000000..9a90aaa
--- /dev/null
+++ b/.golangci.yml
@@ -0,0 +1,115 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+linters:
+ disable-all: true
+ enable:
+ - deadcode
+ - errcheck
+ - gocritic
+ - goconst
+ - gofumpt
+ - goimports
+ - gosimple
+ - govet
+ - ineffassign
+ - lll
+ - misspell
+ - staticcheck
+ - structcheck
+ - stylecheck
+ - typecheck
+ - unconvert
+ - varcheck
+ - prealloc
+ - unused
+ - unparam
+linters-settings:
+ lll:
+ line-length: 170
+ goconst:
+ min-occurrences: 4
+ govet:
+ check-shadowing: true
+ enable:
+ - fieldalignment
+ misspell:
+ locale: US
+ unused:
+ check-exported: false
+ unparam:
+ check-exported: false
+ gocritic:
+ enabled-checks:
+ - appendCombine
+ - argOrder
+ - assignOp
+ - badCond
+ - boolExprSimplify
+ - builtinShadow
+ - captLocal
+ - caseOrder
+ - codegenComment
+ - commentedOutCode
+ - commentedOutImport
+ - defaultCaseOrder
+ - deprecatedComment
+ - docStub
+ - dupArg
+ - dupBranchBody
+ - dupCase
+ - dupSubExpr
+ - elseif
+ - emptyFallthrough
+ - equalFold
+ - flagDeref
+ - flagName
+ - hexLiteral
+ - indexAlloc
+ - initClause
+ - methodExprCall
+ - nilValReturn
+ - octalLiteral
+ - offBy1
+ - rangeExprCopy
+ - regexpMust
+ - sloppyLen
+ - stringXbytes
+ - switchTrue
+ - typeAssertChain
+ - typeSwitchVar
+ - typeUnparen
+ - underef
+ - unlambda
+ - unnecessaryBlock
+ - unslice
+ - valSwap
+ - weakCond
+run:
+ deadline: 20m
+ skip-files:
+ - ".*\\.pb\\.go"
+ - ".*\\.gen\\.go"
+issues:
+ exclude-rules:
+ - path: _test\.go$|^tests/|^samples/
+ linters:
+ - errcheck
+ - maligned
+ - linters:
+ - staticcheck
+ text: "SA1019: package github.com/golang/protobuf"
+ max-per-linter: 0
+ max-same-issues: 0
diff --git a/.licenserc.yaml b/.licenserc.yaml
index 6dfbebb..0bd77ef 100644
--- a/.licenserc.yaml
+++ b/.licenserc.yaml
@@ -80,8 +80,9 @@ header: # `header` section is configurations for source codes license header.
- '**/.gitignore'
- 'ui/dist'
- 'ui/node_modules'
- - 'ui/yarn.lock'
+ - 'ui/package-lock.json'
- 'ui/LICENSE.tpl'
+ - 'ui/.node-version'
comment: on-failure # on what condition license-eye will comment on the pull request, `on-failure`, `always`, `never`.
diff --git a/Makefile b/Makefile
index fc20f16..bbde409 100644
--- a/Makefile
+++ b/Makefile
@@ -92,6 +92,7 @@ check: clean
echo "Upgrade go to $(CONFIGURED_GO_VERSION)+"; \
exit 1; \
esac
+ $(MAKE) license-dep
$(MAKE) format
mkdir -p /tmp/artifacts
git diff >/tmp/artifacts/check.diff 2>&1
diff --git a/api/Makefile b/api/Makefile
index ccd7ea1..bc53d6c 100644
--- a/api/Makefile
+++ b/api/Makefile
@@ -19,6 +19,7 @@
NAME := api
include ../scripts/build/base.mk
+include ../scripts/build/lint.mk
include ../scripts/build/help.mk
proto_dir := $(root_dir)/api/proto
@@ -59,3 +60,4 @@ generate: $(BUF)
lint: $(PROTOC)
@PATH=$(tool_bin):$(proto_dir) $(BUF) lint
+ $(MAKE) lint-desperated
diff --git a/api/common/id.go b/api/common/id.go
index f6a55b4..7443083 100644
--- a/api/common/id.go
+++ b/api/common/id.go
@@ -25,9 +25,11 @@ import (
"github.com/apache/skywalking-banyandb/pkg/convert"
)
-type SeriesID uint64
-type ShardID uint32
-type ItemID uint64
+type (
+ SeriesID uint64
+ ShardID uint32
+ ItemID uint64
+)
func (s SeriesID) Marshal() []byte {
return convert.Uint64ToBytes(uint64(s))
diff --git a/banyand/Makefile b/banyand/Makefile
index 2e253f6..989228b 100644
--- a/banyand/Makefile
+++ b/banyand/Makefile
@@ -29,6 +29,9 @@ include ../scripts/build/build.mk
include ../scripts/build/test.mk
include ../scripts/build/lint.mk
+lint: $(PROTOC)
+ $(MAKE) lint-desperated
+
DOCKER_BUILD_ARGS := --build-arg CERT_IMAGE=alpine:edge --build-arg BASE_IMAGE=golang:${go_version}
include ../scripts/build/docker.mk
diff --git a/bydbctl/internal/cmd/root.go b/bydbctl/internal/cmd/root.go
index f95fbd4..a84f69b 100644
--- a/bydbctl/internal/cmd/root.go
+++ b/bydbctl/internal/cmd/root.go
@@ -23,6 +23,7 @@ import (
"github.com/apache/skywalking-banyandb/pkg/version"
)
+// NewRoot returns the root command
func NewRoot() *cobra.Command {
cmd := &cobra.Command{
DisableAutoGenTag: true,
diff --git a/bydbctl/internal/cmd/root_test.go b/bydbctl/internal/cmd/root_test.go
index 064fad2..943ca0a 100644
--- a/bydbctl/internal/cmd/root_test.go
+++ b/bydbctl/internal/cmd/root_test.go
@@ -23,6 +23,5 @@ import (
var _ = Describe("Root", func() {
It("foo", func() {
-
})
})
diff --git a/golangci.yml b/desperated-golangci.yml
similarity index 97%
rename from golangci.yml
rename to desperated-golangci.yml
index 48a41b3..8f08a1e 100644
--- a/golangci.yml
+++ b/desperated-golangci.yml
@@ -43,9 +43,6 @@ linters-settings:
check-shadowing: true
run:
deadline: 10m
- skip-dirs:
- - docs
- - ui
issues:
exclude:
# staticcheck
diff --git a/dist/LICENSE b/dist/LICENSE
index a4f9029..aa3468b 100644
--- a/dist/LICENSE
+++ b/dist/LICENSE
@@ -174,66 +174,17 @@
of your accepting any such warranty or additional liability.
-========================================================================
-BSD-2-Clause licenses
-========================================================================
-
- github.com/pkg/errors v0.9.1 BSD-2-Clause
- github.com/gorilla/websocket v1.4.2 BSD-2-Clause
- github.com/magiconair/properties v1.8.6 BSD-2-Clause
-
-========================================================================
-ISC licenses
-========================================================================
-
- github.com/davecgh/go-spew v1.1.1 ISC
-
-========================================================================
-BSD-3-Clause licenses
-========================================================================
-
- github.com/golang/protobuf v1.5.2 BSD-3-Clause
- github.com/google/go-cmp v0.5.8 BSD-3-Clause
- github.com/google/uuid v1.3.0 BSD-3-Clause
- github.com/spf13/pflag v1.0.5 BSD-3-Clause
- golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a BSD-3-Clause
- google.golang.org/protobuf v1.28.0 BSD-3-Clause
- golang.org/x/exp v0.0.0-20220602145555-4a0574d9293f BSD-3-Clause
- github.com/bits-and-blooms/bitset v1.2.0 BSD-3-Clause
- github.com/fsnotify/fsnotify v1.5.4 BSD-3-Clause
- github.com/gogo/protobuf v1.3.2 BSD-3-Clause
- github.com/golang/snappy v0.0.3 BSD-3-Clause
- github.com/grpc-ecosystem/grpc-gateway v1.16.0 BSD-3-Clause
- github.com/pmezard/go-difflib v1.0.0 BSD-3-Clause
- golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 BSD-3-Clause
- golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 BSD-3-Clause
- golang.org/x/text v0.3.7 BSD-3-Clause
- golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba BSD-3-Clause
-
-========================================================================
-BSD-3-Clause and Apache-2.0 and MIT and BSD-3-Clause and MIT licenses
-========================================================================
-
- github.com/klauspost/compress v1.15.6 BSD-3-Clause and Apache-2.0 and MIT and BSD-3-Clause and MIT
-
========================================================================
Apache-2.0 licenses
========================================================================
github.com/SkyAPM/badger/v3 v3.0.0-20220403004319-fea65bd5e9e4 Apache-2.0
- github.com/dgraph-io/ristretto v0.1.0 Apache-2.0
- github.com/golang/mock v1.6.0 Apache-2.0
- github.com/oklog/run v1.1.0 Apache-2.0
- github.com/spf13/cobra v1.4.0 Apache-2.0
- go.etcd.io/etcd/client/v3 v3.5.4 Apache-2.0
- go.etcd.io/etcd/server/v3 v3.5.4 Apache-2.0
- google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd Apache-2.0
- google.golang.org/grpc v1.47.0 Apache-2.0
- github.com/prometheus/client_golang v1.12.2 Apache-2.0
github.com/coreos/go-semver v0.3.0 Apache-2.0
github.com/coreos/go-systemd/v22 v22.3.2 Apache-2.0
+ github.com/dgraph-io/ristretto v0.1.0 Apache-2.0
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b Apache-2.0
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da Apache-2.0
+ github.com/golang/mock v1.6.0 Apache-2.0
github.com/google/btree v1.0.1 Apache-2.0
github.com/google/flatbuffers v1.12.1 Apache-2.0
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 Apache-2.0
@@ -244,16 +195,21 @@ Apache-2.0 licenses
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd Apache-2.0
github.com/modern-go/reflect2 v1.0.2 Apache-2.0
github.com/mschoch/smat v0.2.0 Apache-2.0
+ github.com/oklog/run v1.1.0 Apache-2.0
+ github.com/prometheus/client_golang v1.12.2 Apache-2.0
github.com/prometheus/client_model v0.2.0 Apache-2.0
github.com/prometheus/common v0.32.1 Apache-2.0
github.com/prometheus/procfs v0.7.3 Apache-2.0
github.com/soheilhy/cmux v0.1.5 Apache-2.0
github.com/spf13/afero v1.8.2 Apache-2.0
+ github.com/spf13/cobra v1.4.0 Apache-2.0
go.etcd.io/etcd/api/v3 v3.5.4 Apache-2.0
go.etcd.io/etcd/client/pkg/v3 v3.5.4 Apache-2.0
go.etcd.io/etcd/client/v2 v2.305.4 Apache-2.0
+ go.etcd.io/etcd/client/v3 v3.5.4 Apache-2.0
go.etcd.io/etcd/pkg/v3 v3.5.4 Apache-2.0
go.etcd.io/etcd/raft/v3 v3.5.4 Apache-2.0
+ go.etcd.io/etcd/server/v3 v3.5.4 Apache-2.0
go.opencensus.io v0.23.0 Apache-2.0
go.opentelemetry.io/contrib v0.20.0 Apache-2.0
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0 Apache-2.0
@@ -265,66 +221,110 @@ Apache-2.0 licenses
go.opentelemetry.io/otel/sdk/metric v0.20.0 Apache-2.0
go.opentelemetry.io/otel/trace v0.20.0 Apache-2.0
go.opentelemetry.io/proto/otlp v0.7.0 Apache-2.0
+ google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd Apache-2.0
+ google.golang.org/grpc v1.47.0 Apache-2.0
gopkg.in/ini.v1 v1.66.4 Apache-2.0
gopkg.in/yaml.v2 v2.4.0 Apache-2.0
========================================================================
-MPL-2.0 licenses
+Apache-2.0 and BSD-3-Clause licenses
========================================================================
- github.com/hashicorp/golang-lru v0.5.4 MPL-2.0
- github.com/hashicorp/hcl v1.0.0 MPL-2.0
+ github.com/RoaringBitmap/roaring v0.9.1 Apache-2.0 and BSD-3-Clause
========================================================================
-MIT and Apache-2.0 licenses
+BSD-2-Clause licenses
========================================================================
- github.com/pelletier/go-toml v1.9.5 MIT and Apache-2.0
- gopkg.in/yaml.v3 v3.0.0 MIT and Apache-2.0
+ github.com/gorilla/websocket v1.4.2 BSD-2-Clause
+ github.com/magiconair/properties v1.8.6 BSD-2-Clause
+ github.com/pkg/errors v0.9.1 BSD-2-Clause
========================================================================
-MIT and BSD-3-Clause licenses
+BSD-3-Clause licenses
========================================================================
- sigs.k8s.io/yaml v1.2.0 MIT and BSD-3-Clause
+ github.com/bits-and-blooms/bitset v1.2.0 BSD-3-Clause
+ github.com/fsnotify/fsnotify v1.5.4 BSD-3-Clause
+ github.com/gogo/protobuf v1.3.2 BSD-3-Clause
+ github.com/golang/protobuf v1.5.2 BSD-3-Clause
+ github.com/golang/snappy v0.0.3 BSD-3-Clause
+ github.com/google/go-cmp v0.5.8 BSD-3-Clause
+ github.com/google/uuid v1.3.0 BSD-3-Clause
+ github.com/grpc-ecosystem/grpc-gateway v1.16.0 BSD-3-Clause
+ github.com/pmezard/go-difflib v1.0.0 BSD-3-Clause
+ github.com/spf13/pflag v1.0.5 BSD-3-Clause
+ golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 BSD-3-Clause
+ golang.org/x/exp v0.0.0-20220602145555-4a0574d9293f BSD-3-Clause
+ golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 BSD-3-Clause
+ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a BSD-3-Clause
+ golang.org/x/text v0.3.7 BSD-3-Clause
+ golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba BSD-3-Clause
+ google.golang.org/protobuf v1.28.0 BSD-3-Clause
========================================================================
-Apache-2.0 and BSD-3-Clause licenses
+BSD-3-Clause and Apache-2.0 and MIT licenses
========================================================================
- github.com/RoaringBitmap/roaring v0.9.1 Apache-2.0 and BSD-3-Clause
+ github.com/klauspost/compress v1.15.6 BSD-3-Clause and Apache-2.0 and MIT
+
+========================================================================
+ISC licenses
+========================================================================
+
+ github.com/davecgh/go-spew v1.1.1 ISC
========================================================================
MIT licenses
========================================================================
github.com/SkyAPM/clock v1.3.1-0.20220416123716-97dcb111a8d8 MIT
- github.com/cespare/xxhash v1.1.0 MIT
- github.com/onsi/ginkgo/v2 v2.1.4 MIT
- github.com/onsi/gomega v1.19.0 MIT
- github.com/rs/zerolog v1.26.1 MIT
- github.com/spf13/viper v1.12.0 MIT
- github.com/stretchr/testify v1.7.1 MIT
- go.uber.org/multierr v1.8.0 MIT
- go.uber.org/atomic v1.9.0 MIT
github.com/beorn7/perks v1.0.1 MIT
+ github.com/cespare/xxhash v1.1.0 MIT
github.com/cespare/xxhash/v2 v2.1.2 MIT
github.com/dustin/go-humanize v1.0.0 MIT
github.com/form3tech-oss/jwt-go v3.2.3+incompatible MIT
github.com/json-iterator/go v1.1.12 MIT
github.com/mitchellh/mapstructure v1.5.0 MIT
+ github.com/onsi/ginkgo/v2 v2.1.4 MIT
+ github.com/onsi/gomega v1.19.0 MIT
github.com/pelletier/go-toml/v2 v2.0.1 MIT
+ github.com/rs/zerolog v1.26.1 MIT
github.com/sirupsen/logrus v1.7.0 MIT
github.com/spf13/cast v1.5.0 MIT
github.com/spf13/jwalterweatherman v1.1.0 MIT
+ github.com/spf13/viper v1.12.0 MIT
github.com/stretchr/objx v0.1.1 MIT
+ github.com/stretchr/testify v1.7.1 MIT
github.com/subosito/gotenv v1.3.0 MIT
github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802 MIT
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 MIT
go.etcd.io/bbolt v1.3.6 MIT
+ go.uber.org/atomic v1.9.0 MIT
+ go.uber.org/multierr v1.8.0 MIT
go.uber.org/zap v1.17.0 MIT
gopkg.in/natefinch/lumberjack.v2 v2.0.0 MIT
+========================================================================
+MIT and Apache-2.0 licenses
+========================================================================
+
+ github.com/pelletier/go-toml v1.9.5 MIT and Apache-2.0
+ gopkg.in/yaml.v3 v3.0.0 MIT and Apache-2.0
+
+========================================================================
+MIT and BSD-3-Clause licenses
+========================================================================
+
+ sigs.k8s.io/yaml v1.2.0 MIT and BSD-3-Clause
+
+========================================================================
+MPL-2.0 licenses
+========================================================================
+
+ github.com/hashicorp/golang-lru v0.5.4 MPL-2.0
+ github.com/hashicorp/hcl v1.0.0 MPL-2.0
+
========================================================================
UI related licenses
========================================================================
@@ -337,6 +337,9 @@ The text of each license is also included at licenses/ui-licenses/LICENSE-[proje
MIT licenses
========================================================================
+ bindings 1.5.0 MIT
core-js 3.22.8 MIT
- vue-router 3.5.4 MIT
+ file-uri-to-path 1.0.0 MIT
+ nan 2.16.0 MIT
vue 2.6.14 MIT
+ vue-router 3.5.4 MIT
diff --git a/dist/licenses/ui-licenses/license-bindings.txt b/dist/licenses/ui-licenses/license-bindings.txt
new file mode 100644
index 0000000..5a92289
--- /dev/null
+++ b/dist/licenses/ui-licenses/license-bindings.txt
@@ -0,0 +1,22 @@
+(The MIT License)
+
+Copyright (c) 2012 Nathan Rajlich <nathan@tootallnate.net>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/dist/licenses/ui-licenses/license-file-uri-to-path.txt b/dist/licenses/ui-licenses/license-file-uri-to-path.txt
new file mode 100644
index 0000000..e1af783
--- /dev/null
+++ b/dist/licenses/ui-licenses/license-file-uri-to-path.txt
@@ -0,0 +1,20 @@
+Copyright (c) 2014 Nathan Rajlich <na...@tootallnate.net>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/dist/licenses/ui-licenses/license-nan.txt b/dist/licenses/ui-licenses/license-nan.txt
new file mode 100644
index 0000000..2d33043
--- /dev/null
+++ b/dist/licenses/ui-licenses/license-nan.txt
@@ -0,0 +1,9 @@
+The MIT License (MIT)
+
+Copyright (c) 2018 [NAN contributors](<https://github.com/nodejs/nan#wg-members--collaborators>)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/pkg/Makefile b/pkg/Makefile
index 043bc21..0f94713 100644
--- a/pkg/Makefile
+++ b/pkg/Makefile
@@ -23,3 +23,6 @@ include ../scripts/build/generate_go.mk
include ../scripts/build/test.mk
include ../scripts/build/lint.mk
include ../scripts/build/help.mk
+
+lint: $(PROTOC)
+ $(MAKE) lint-desperated
diff --git a/revive.toml b/revive.toml
new file mode 100644
index 0000000..0cae753
--- /dev/null
+++ b/revive.toml
@@ -0,0 +1,40 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+ignoreGeneratedHeader = false
+severity = "warning"
+confidence = 0.8
+errorCode = 1
+warningCode = 1
+
+[rule.blank-imports]
+[rule.context-as-argument]
+[rule.context-keys-type]
+[rule.dot-imports]
+[rule.error-return]
+[rule.error-strings]
+[rule.error-naming]
+[rule.exported]
+[rule.if-return]
+[rule.increment-decrement]
+[rule.var-naming]
+[rule.var-declaration]
+[rule.package-comments]
+[rule.range]
+[rule.receiver-naming]
+[rule.time-naming]
+[rule.unexported-return]
+[rule.indent-error-flow]
+[rule.errorf]
diff --git a/scripts/build/license.mk b/scripts/build/license.mk
index c739e90..2487e77 100644
--- a/scripts/build/license.mk
+++ b/scripts/build/license.mk
@@ -20,4 +20,4 @@ LICENSE_EYE := $(tool_bin)/license-eye
$(LICENSE_EYE):
@echo "Install license-eye..."
@mkdir -p $(tool_bin)
- @GOBIN=$(tool_bin) go install github.com/apache/skywalking-eyes/cmd/license-eye@5f15d230a1914858ebccba7664026ffc7288b670
+ @GOBIN=$(tool_bin) go install github.com/apache/skywalking-eyes/cmd/license-eye@35c6a02375648f83f211b2eebb53f345e95b35c7
diff --git a/scripts/build/lint.mk b/scripts/build/lint.mk
index e829cec..192a1e2 100644
--- a/scripts/build/lint.mk
+++ b/scripts/build/lint.mk
@@ -26,6 +26,15 @@ LINTER := $(tool_bin)/golangci-lint
$(LINTER):
@wget -O - -q https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(root_dir)/bin $(GOLANGCI_VERSION)
+REVIVE := $(tool_bin)/revive
+$(REVIVE):
+ @GOBIN=$(tool_bin) go install github.com/mgechev/revive@latest
+
.PHONY: lint
-lint: $(LINTER) ## Run all the linters
- $(LINTER) --verbose run $(LINT_OPTS) --config $(root_dir)/golangci.yml
+lint: $(LINTER) $(REVIVE) ## Run all linters
+ $(LINTER) run -v --config $(root_dir)/.golangci.yml ./... && \
+ $(REVIVE) -config $(root_dir)/revive.toml -formatter friendly ./...
+
+.PHONY: lint-desperated
+lint-desperated: $(LINTER)
+ $(LINTER) --verbose run $(LINT_OPTS) --config $(root_dir)/desperated-golangci.yml
diff --git a/ui/.gitignore b/ui/.gitignore
index 14edac1..d270319 100644
--- a/ui/.gitignore
+++ b/ui/.gitignore
@@ -18,5 +18,4 @@
# Binaries for programs and plugins
dist
node_modules
-yarn.lock
package-lock.json
diff --git a/ui/.licenserc.yaml b/ui/.licenserc.yaml
index 223740f..7b36ce0 100644
--- a/ui/.licenserc.yaml
+++ b/ui/.licenserc.yaml
@@ -63,7 +63,7 @@ header: # `header` section is configurations for source codes license header.
paths-ignore: # `paths-ignore` are the path list that will be ignored by license-eye.
- 'dist'
- 'node_modules'
- - 'yarn.lock'
+ - 'package-lock.json'
comment: on-failure # on what condition license-eye will comment on the pull request, `on-failure`, `always`, `never`.
diff --git a/ui/.node-version b/ui/.node-version
new file mode 100644
index 0000000..c818c7b
--- /dev/null
+++ b/ui/.node-version
@@ -0,0 +1 @@
+16.15.0
\ No newline at end of file
diff --git a/ui/LICENSE b/ui/LICENSE
index 00159a6..fed6750 100644
--- a/ui/LICENSE
+++ b/ui/LICENSE
@@ -10,6 +10,9 @@ The text of each license is also included at licenses/ui-licenses/LICENSE-[proje
MIT licenses
========================================================================
+ bindings 1.5.0 MIT
core-js 3.22.8 MIT
- vue-router 3.5.4 MIT
+ file-uri-to-path 1.0.0 MIT
+ nan 2.16.0 MIT
vue 2.6.14 MIT
+ vue-router 3.5.4 MIT
diff --git a/ui/Makefile b/ui/Makefile
index bc00771..ab37145 100644
--- a/ui/Makefile
+++ b/ui/Makefile
@@ -21,11 +21,15 @@ DIST_INDEX := dist/index.html
include ../scripts/build/base.mk
include ../scripts/build/license.mk
+include ../scripts/build/lint.mk
include ../scripts/build/help.mk
+check-version:
+ @node tools/checkversion
+
.PHONY: install
-install:
- yarn install
+install: check-version
+ npm install
.PHONY: generate
generate: build
@@ -36,7 +40,7 @@ all: build
.PHONY: build
build: install
@echo "Building $(NAME)"
- yarn build
+ npm run build
@echo "Done building $(NAME)"
.PHONY: test
@@ -46,10 +50,6 @@ test:
.PHONY: release
release: build
-.PHONY: lint
-lint:
- @echo "No lint"
-
.PHONY: docker
docker: build
@echo "BanyanD will embed the UI"
diff --git a/ui/README.md b/ui/README.md
index 89128c9..3bd90e2 100644
--- a/ui/README.md
+++ b/ui/README.md
@@ -1,19 +1,23 @@
# frontend
## Project setup
-```
-yarn install
+
+```shell
+npm install
```
### Compiles and hot-reloads for development
-```
-yarn serve
+
+```shell
+npm run serve
```
### Compiles and minifies for production
-```
-yarn build
+
+```shell
+npm run build
```
### Customize configuration
+
See [Configuration Reference](https://cli.vuejs.org/config/).
diff --git a/ui/tools/checkversion.js b/ui/tools/checkversion.js
new file mode 100644
index 0000000..a50ce44
--- /dev/null
+++ b/ui/tools/checkversion.js
@@ -0,0 +1,32 @@
+/*
+ * Licensed to Apache Software Foundation (ASF) under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Apache Software Foundation (ASF) licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+const fs = require("fs");
+
+const nvmVersion = fs.readFileSync(".node-version").toString().trim();
+const desired = `v${nvmVersion}`;
+const running = process.version;
+
+if (!running.startsWith(desired)) {
+ console.error(
+ `You are running Node ${running} but version ${desired} is expected. ` +
+ `Use nvm or another version manager to install ${desired}, and then activate it.`
+ );
+ process.exit(1);
+}