Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (40 loc) · 1.73 KB
/
Copy pathMakefile
File metadata and controls
44 lines (40 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# SPDX-license-identifier: Apache-2.0
##############################################################################
# Copyright (c) 2021
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
DOCKER_CMD ?= $(shell which docker 2> /dev/null || which podman 2> /dev/null || echo docker)
.PHONY: lint
lint: cleanup
sudo -E $(DOCKER_CMD) run --rm -v $$(pwd):/tmp/lint \
-e RUN_LOCAL=true \
-e LINTER_RULES_PATH=/ \
-e VALIDATE_JSCPD=false \
-e VALIDATE_SHELL_SHFMT=false \
-e VALIDATE_CHECKOV=false \
-e VALIDATE_TRIVY=false \
-e VALIDATE_BIOME_LINT=false \
-e VALIDATE_BIOME_FORMAT=false \
-e VALIDATE_ENV=false \
-e VALIDATE_PYTHON_RUFF_FORMAT=false \
-e EDITORCONFIG_FILE_NAME=.editorconfig-checker.json \
-e KUBERNETES_KUBECONFORM_OPTIONS='-ignore-missing-schemas -ignore-filename-pattern custom-rules.yml' \
ghcr.io/super-linter/super-linter
tox -e lint
.PHONY: cleanup
cleanup:
rm -rf node_modules
rm -rf .tox/ .venv/
.PHONY: fmt
fmt: cleanup
command -v shfmt > /dev/null || curl -s "https://i.jpillora.com/mvdan/sh!!?as=shfmt" | bash
shfmt -l -w -s -i 4 .
command -v yamlfmt > /dev/null || curl -s "https://i.jpillora.com/google/yamlfmt!!" | bash
yamlfmt -dstar **/*.{yaml,yml}
npm list --depth=0 textlint textlint-rule-terminology >/dev/null 2>&1 || npm install --save-dev textlint textlint-rule-terminology
npx --no-install textlint . --fix
npm list --depth=0 prettier >/dev/null 2>&1 || npm install --save-dev prettier
npx --no-install prettier . --write --ignore-unknown