diff --git a/.dockerignore b/.dockerignore index c342702b73..609440e8a3 100644 --- a/.dockerignore +++ b/.dockerignore @@ -4,7 +4,6 @@ .dockerignore .gitignore .golangci.yml -.markdownlintrc *.out bin/ hack/.bin/ diff --git a/.markdownlintrc b/.markdownlintrc deleted file mode 100644 index 7311210fa1..0000000000 --- a/.markdownlintrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "default": true, - "line_length": false -} \ No newline at end of file diff --git a/Makefile b/Makefile index 8059e62e1b..b83da231b5 100644 --- a/Makefile +++ b/Makefile @@ -320,25 +320,11 @@ generate-e2e-templates: ## Generate e2e cluster templates .PHONY: lint lint: $(GOLANGCI_LINT) ## Lint the codebase - $(MAKE) lint-go-full - $(MAKE) lint-markdown - -GOLANGCI_LINT_EXTRA_ARGS ?= --fast=true -.PHONY: lint-go -lint-go: $(GOLANGCI_LINT) ## Lint codebase $(GOLANGCI_LINT) run -v $(GOLANGCI_LINT_EXTRA_ARGS) -.PHONY: lint-go-full -lint-go-full: GOLANGCI_LINT_EXTRA_ARGS = --fast=false -lint-go-full: lint-go ## Run slower linters to detect possible issues - -.PHONY: lint-markdown -lint-markdown: ## Lint the project's markdown - docker run --rm -v "$$(pwd)":/build$(DOCKER_VOL_OPTS) gcr.io/cluster-api-provider-vsphere/extra/mdlint:0.17.0 -- /md/lint -i contrib/haproxy/openapi -i _releasenotes . - .PHONY: lint-fix lint-fix: $(GOLANGCI_LINT) ## Lint the codebase and run auto-fixers if supported by the linter - GOLANGCI_LINT_EXTRA_ARGS="--fast=false --fix" $(MAKE) lint-go + GOLANGCI_LINT_EXTRA_ARGS=--fix $(MAKE) lint APIDIFF_OLD_COMMIT ?= $(shell git rev-parse origin/main) @@ -349,7 +335,7 @@ apidiff: $(GO_APIDIFF) ## Check for API differences ALL_VERIFY_CHECKS = boilerplate shellcheck modules gen conversions doctoc flavors .PHONY: verify -verify: $(addprefix verify-,$(ALL_VERIFY_CHECKS)) lint-markdown ## Run all verify-* targets +verify: $(addprefix verify-,$(ALL_VERIFY_CHECKS)) ## Run all verify-* targets .PHONY: verify-modules verify-modules: generate-modules ## Verify go modules are up to date diff --git a/hack/check-format.sh b/hack/check-format.sh deleted file mode 100755 index 5d96abb606..0000000000 --- a/hack/check-format.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -# Copyright 2019 The Kubernetes Authors. -# -# Licensed 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. - -set -o errexit -set -o nounset -set -o pipefail - -# Change directories to the parent directory of the one in which this -# script is located. -cd "$(dirname "${BASH_SOURCE[0]}")/.." - -# This file has been deprecated in favor of the Makefile target "lint-go". -# This file remains as a backwards-compatible stub for the CI tests since -# older release branches still expect this file to exist. -make lint-go diff --git a/hack/check-lint.sh b/hack/check-lint.sh deleted file mode 100755 index 5d96abb606..0000000000 --- a/hack/check-lint.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -# Copyright 2019 The Kubernetes Authors. -# -# Licensed 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. - -set -o errexit -set -o nounset -set -o pipefail - -# Change directories to the parent directory of the one in which this -# script is located. -cd "$(dirname "${BASH_SOURCE[0]}")/.." - -# This file has been deprecated in favor of the Makefile target "lint-go". -# This file remains as a backwards-compatible stub for the CI tests since -# older release branches still expect this file to exist. -make lint-go diff --git a/hack/check-mdlint.sh b/hack/check-mdlint.sh deleted file mode 100755 index 9de2fd0f8f..0000000000 --- a/hack/check-mdlint.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -# Copyright 2019 The Kubernetes Authors. -# -# Licensed 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. - -set -o errexit -set -o nounset -set -o pipefail - -# Change directories to the parent directory of the one in which this -# script is located. -cd "$(dirname "${BASH_SOURCE[0]}")/.." - -# This file has been deprecated in favor of the Makefile target "lint-markdown". -# This file remains as a backwards-compatible stub for the CI tests since -# older release branches still expect this file to exist. -make lint-markdown diff --git a/hack/check-vet.sh b/hack/check-vet.sh deleted file mode 100755 index 4ea1fea425..0000000000 --- a/hack/check-vet.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -# Copyright 2018 The Kubernetes Authors. -# -# Licensed 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. - -set -o errexit -set -o nounset -set -o pipefail - -# Change directories to the parent directory of the one in which this -# script is located. -cd "$(dirname "${BASH_SOURCE[0]}")/.." - -# This file has been deprecated in favor of the Makefile target "lint-go". -# This file remains as a backwards-compatible stub for the CI tests since -# older release branches still expect this file to exist. -make lint-go diff --git a/hack/tools/mdlint/Dockerfile b/hack/tools/mdlint/Dockerfile deleted file mode 100644 index 9de4a4d85d..0000000000 --- a/hack/tools/mdlint/Dockerfile +++ /dev/null @@ -1,34 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -# Copyright 2019 The Kubernetes Authors. -# -# Licensed 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. - -################################################################################ -## INSTALL MDLINT ## -################################################################################ -FROM node:12.6.0-slim as build -ARG MDLINT_CLI_VERSION=0.31.1 -ENV MDLINT_CLI_VERSION=${MDLINT_CLI_VERSION} -RUN npm install -g --prefix=/md markdownlint-cli@${MDLINT_CLI_VERSION} && \ - ln -s /md/lib/node_modules/markdownlint-cli/markdownlint.js /md/lint - -################################################################################ -## RUN MDLINT ## -################################################################################ -FROM gcr.io/distroless/nodejs:latest -LABEL "maintainer" "Andrew Kutz " -COPY --from=build /md/ /md/ -WORKDIR /build -CMD [ "/md/lint", "-i", "vendor", "." ] -ENTRYPOINT [ "/nodejs/bin/node" ] diff --git a/hack/tools/mdlint/Makefile b/hack/tools/mdlint/Makefile deleted file mode 100644 index 60af48c611..0000000000 --- a/hack/tools/mdlint/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright 2019 The Kubernetes Authors. -# -# Licensed 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. - -all: build - -MDLINT_CLI_VERSION ?= 0.31.1 -IMAGE_NAME ?= gcr.io/cluster-api-provider-vsphere/extra/mdlint -IMAGE_TAG ?= $(IMAGE_NAME):$(MDLINT_CLI_VERSION) - -build: - docker build --build-arg MDLINT_CLI_VERSION=$(MDLINT_CLI_VERSION) -t $(IMAGE_TAG) . - docker tag $(IMAGE_TAG) $(IMAGE_NAME):latest -.PHONY: build - -push: - docker push $(IMAGE_TAG) - docker push $(IMAGE_NAME):latest -.PHONY: push