Skip to content

Commit

Permalink
Add more linters to the lint_modern target. (istio#17240)
Browse files Browse the repository at this point in the history
- Also delete some redundant config files.
  • Loading branch information
geeknoid authored and istio-testing committed Sep 20, 2019
1 parent 8bea9c2 commit 475e4eb
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 239 deletions.
1 change: 0 additions & 1 deletion .commonfiles.sha

This file was deleted.

194 changes: 0 additions & 194 deletions .golangci.yml

This file was deleted.

5 changes: 5 additions & 0 deletions Makefile.core.mk
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,11 @@ shellcheck:
MARKDOWN_LINT_WHITELIST=localhost:8080,storage.googleapis.com/istio-artifacts/pilot/,http://ratings.default.svc.cluster.local:9080/ratings

lint_modern: lint-python lint-copyright-banner lint-scripts lint-dockerfiles lint-markdown lint-yaml
@bin/check_helm.sh
@GOARCH=amd64 GOOS=linux bin/check_samples.sh
@GOARCH=amd64 GOOS=linux bin/check_dashboards.sh
@GOARCH=amd64 GOOS=linux go run mixer/tools/adapterlinter/main.go ./mixer/adapter/...
@GOARCH=amd64 GOOS=linux bin/check_pilot_codegen.sh
@golangci-lint run -c ./common/config/.golangci.yml ./galley/...
@golangci-lint run -c ./common/config/.golangci.yml ./istioctl/...
@golangci-lint run -c ./common/config/.golangci.yml ./mixer/...
Expand Down
27 changes: 27 additions & 0 deletions bin/check_helm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

# Copyright Istio 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 -e

SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ROOTDIR=$(dirname "${SCRIPTPATH}")
cd "${ROOTDIR}"

helm lint ./install/kubernetes/helm/istio
helm template install/kubernetes/helm/istio --name istio --namespace istio-system -x templates/configmap.yaml | grep -q " $" && echo "templates/configmap.yaml has trailing spaces" && exit 1
helm template install/kubernetes/helm/istio --name istio --namespace istio-system -x templates/sidecar-injector-configmap.yaml | grep -q " $" && exit 1

exit 0
7 changes: 1 addition & 6 deletions bin/yaml_lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,4 @@ SCRIPTPATH=$( cd "$(dirname "$0")" ; pwd -P )
ROOTDIR=$SCRIPTPATH/..
cd "$ROOTDIR"

PKGS=${PKGS:-"."}
if [[ -z ${YAML_FILES} ]];then
find "${PKGS}" -type f -name '*.yaml' | grep -v ./vendor | grep -v -E "\/templates\/" | grep -v -E "template" | xargs yamllint -c ./bin/yamllintrules
fi

exit $?
find . \( -path ./common-protos -o -path ./.git -o -path ./.github \) -prune -o -type f \( -name '*.yml' -o -name '*.yaml' \) -print0 | xargs -0 grep -L -e "{{" | xargs yamllint -c ./common/config/.yamllint.yml
37 changes: 0 additions & 37 deletions bin/yamllintrules

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/run_golangci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ GOLANGCI_VERSION="v1.18.0"
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b "$GOPATH"/bin "$GOLANGCI_VERSION"
golangci-lint --version
# For tuning and when switching versions PLEASE REFERENCE: https://github.com/istio/istio/issues/14888
env GOGC=25 golangci-lint run ${FIX} -v ./...
env GOGC=25 golangci-lint run -c ./common/config/.golangci.yml ${FIX} -v ./...

0 comments on commit 475e4eb

Please sign in to comment.