mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-04-28 14:29:19 +08:00
feat: Remove Go Typecheck Tools Implement GitHub Actions Based Typecheck for OpenIM (#2140)
* feat: remove go typecheck tools * feat: add actions go typecheck tools * Update verify-typecheck.sh
This commit is contained in:
@@ -237,6 +237,17 @@ install.richgo:
|
||||
install.rts:
|
||||
@$(GO) install github.com/galeone/rts/cmd/rts@latest
|
||||
|
||||
# ================= kubecub openim tools =========================================
|
||||
## install.typecheck: install kubecub typecheck check for go code
|
||||
.PHONY: install.typecheck
|
||||
install.typecheck:
|
||||
@$(GO) install github.com/kubecub/typecheck@latest
|
||||
|
||||
## install.comment-lang-detector: install kubecub comment-lang-detector check for go code comment language
|
||||
.PHONY: install.comment-lang-detector
|
||||
install.comment-lang-detector:
|
||||
@$(GO) install github.com/kubecub/comment-lang-detector/cmd/cld@latest
|
||||
|
||||
## tools.help: Display help information about the tools package
|
||||
.PHONY: tools.help
|
||||
tools.help: scripts/make-rules/tools.mk
|
||||
|
||||
@@ -20,10 +20,6 @@
|
||||
# the project.
|
||||
# Usage: `scripts/run-in-gopath.sh <command>`.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
||||
source "${OPENIM_ROOT}/scripts/lib/init.sh"
|
||||
|
||||
|
||||
@@ -18,10 +18,6 @@
|
||||
# immediately before exporting docs. We do not want to check these documents in
|
||||
# by default.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
||||
source "${OPENIM_ROOT}/scripts/lib/init.sh"
|
||||
|
||||
@@ -33,7 +29,7 @@ BINS=(
|
||||
genman
|
||||
genyaml
|
||||
)
|
||||
make -C "${OPENIM_ROOT}" WHAT="${BINS[*]}"
|
||||
make -C "${OPENIM_ROOT}" BINS="${BINS[*]}"
|
||||
|
||||
openim::util::ensure-temp-dir
|
||||
|
||||
|
||||
@@ -13,11 +13,6 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
||||
source "${OPENIM_ROOT}/scripts/lib/init.sh"
|
||||
|
||||
|
||||
@@ -17,10 +17,6 @@
|
||||
# This script lints each shell script by `shellcheck`.
|
||||
# Usage: `scripts/verify-shellcheck.sh`.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
||||
source "${OPENIM_ROOT}/scripts/lib/init.sh"
|
||||
|
||||
|
||||
@@ -17,10 +17,6 @@
|
||||
# working directory by client9/misspell package.
|
||||
# Usage: `scripts/verify-spelling.sh`.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
||||
export OPENIM_ROOT
|
||||
source "${OPENIM_ROOT}/scripts/lib/init.sh"
|
||||
|
||||
@@ -16,26 +16,19 @@
|
||||
# This script does a fast type check of script srnetes code for all platforms.
|
||||
# Usage: `scripts/verify-typecheck.sh`.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
||||
source "${OPENIM_ROOT}/scripts/lib/init.sh"
|
||||
|
||||
openim::golang::verify_go_version
|
||||
|
||||
cd "${OPENIM_ROOT}"
|
||||
|
||||
# As of June, 2020 the typecheck tool is written in terms of go/packages, but
|
||||
# that library doesn't work well with multiple modules. Until that is done,
|
||||
# force this tooling to run in a fake GOPATH.
|
||||
ret=0
|
||||
TYPECHECK_SERIAL="${TYPECHECK_SERIAL:-false}"
|
||||
scripts/run-in-gopath.sh \
|
||||
go run test/typecheck/typecheck.go "$@" "--serial=$TYPECHECK_SERIAL" || ret=$?
|
||||
make tools.verify.typecheck
|
||||
${OPENIM_ROOT}/_output/tools/typecheck "$@" "--serial=$TYPECHECK_SERIAL" || ret=$?
|
||||
if [[ $ret -ne 0 ]]; then
|
||||
openim::log::error "Type Check has failed. This may cause cross platform build failures." >&2
|
||||
openim::log::error "Please see https://github.com/openimsdk/open-im-server/tree/main/test/typecheck for more information." >&2
|
||||
openim::log::error "Please see https://github.com/kubecub/typecheck for more information." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -19,10 +19,6 @@
|
||||
#
|
||||
# Usage: `scripts/verify-yamlfmt.sh`.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
||||
source "${OPENIM_ROOT}/scripts/lib/init.sh"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user