-
Notifications
You must be signed in to change notification settings - Fork 0
177 lines (166 loc) · 5.04 KB
/
linter.yml
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
name: Linter
on:
push:
branches-ignore:
- 'dependabot/**'
workflow_call:
inputs:
install-all:
description: 'Install dependencies using `install-all`'
required: false
type: boolean
default: false
generate-keys:
description: 'Whether to run command for dummy key generation'
required: false
type: boolean
default: false
log-level:
description: 'Which log level to use for `super-linter`'
required: false
type: string
default: 'VERBOSE'
validate-all-codebase:
description: 'Whether to run validation on all files'
required: false
type: boolean
default: true
env:
CSS_FILE_NAME: /.stylelintrc.json
DEFAULT_BRANCH: main
DOCKERFILE_HADOLINT_FILE_NAME: /.utils/.github/linters/hadolint.yaml
EDITORCONFIG_FILE_NAME: /.editorconfig
FILTER_REGEX_EXCLUDE: .*(ati-smarttag.js|skycons.js|.github/workflows/*|docs/ARCHITECTURE/*|traffic/sftp/*|tmp/*|.mp3|.php|.gpg|.drawio|demo.ejs)
IGNORE_GITIGNORED_FILES: true
JAVASCRIPT_DEFAULT_STYLE: prettier
JAVASCRIPT_ES_CONFIG_FILE: /.eslintrc.json
JSCPD_CONFIG_FILE: /.utils/.github/linters/jscpd.json
KUBERNETES_KUBEVAL_OPTIONS: --ignore-missing-schemas
LINTER_RULES_PATH: /
# options: ERROR, WARN, NOTICE, VERBOSE, DEBUG or TRACE
LOG_LEVEL: ${{ inputs.log-level }}
MARKDOWN_CONFIG_FILE: /.markdownlint.yaml
NODE_VERSION: 20
TERRAFORM_TERRASCAN_CONFIG_FILE: /.utils/.github/linters/terrascan.yaml
VALIDATE_ALL_CODEBASE: ${{ inputs.validate-all-codebase }}
VALIDATE_ANSIBLE: false
VALIDATE_ARM: false
# VALIDATE_BASH: true
# VALIDATE_BASH_EXEC: true
VALIDATE_CPP: false
VALIDATE_CLANG_FORMAT: false
VALIDATE_CLOJURE: false
VALIDATE_CLOUDFORMATION: false
VALIDATE_COFFEESCRIPT: false
VALIDATE_CSHARP: false
VALIDATE_CSS: false
VALIDATE_DART: false
# VALIDATE_DOCKERFILE_HADOLINT: true
# VALIDATE_EDITORCONFIG: true
# VALIDATE_ENV: true
VALIDATE_GHERKIN: false
# VALIDATE_GITHUB_ACTIONS: true
# VALIDATE_GITLEAKS: true
VALIDATE_GO: false
VALIDATE_GOOGLE_JAVA_FORMAT: false
VALIDATE_GROOVY: false
# VALIDATE_HTML: true
VALIDATE_JAVA: false
# VALIDATE_JAVASCRIPT_ES: true
# VALIDATE_JAVASCRIPT_STANDARD: true
# VALIDATE_JSCPD: true
# VALIDATE_JSON: true
# VALIDATE_JSX: true
VALIDATE_KOTLIN: false
VALIDATE_KOTLIN_ANDROID: false
# VALIDATE_KUBERNETES_KUBEVAL: true
VALIDATE_LATEX: false
VALIDATE_LUA: false
# VALIDATE_MARKDOWN: true
# VALIDATE_NATURAL_LANGUAGE: true
VALIDATE_OPENAPI: false
VALIDATE_PERL: false
VALIDATE_PHP: false
VALIDATE_PHP_BUILTIN: false
VALIDATE_PHP_PHPCS: false
VALIDATE_PHP_PHPSTAN: false
VALIDATE_PHP_PSALM: false
# VALIDATE_POWERSHELL: true
VALIDATE_PROTOBUF: false
VALIDATE_PYTHON: false
VALIDATE_PYTHON_BLACK: false
VALIDATE_PYTHON_FLAKE8: false
VALIDATE_PYTHON_ISORT: false
VALIDATE_PYTHON_MYPY: false
VALIDATE_PYTHON_PYLINT: false
VALIDATE_R: false
VALIDATE_RAKU: false
VALIDATE_RUBY: false
VALIDATE_RUST_2015: false
VALIDATE_RUST_2018: false
VALIDATE_RUST_2021: false
VALIDATE_RUST_CLIPPY: false
VALIDATE_SCALAFMT: false
VALIDATE_SHELL_SHFMT: false
VALIDATE_SNAKEMAKE_LINT: false
VALIDATE_SNAKEMAKE_SNAKEFMT: false
VALIDATE_STATES: false
VALIDATE_SQL: false
VALIDATE_SQLFLUFF: false
VALIDATE_TEKTON: false
# VALIDATE_TERRAFORM_TERRASCAN: true
# VALIDATE_TERRAFORM_TFLINT: true
VALIDATE_TERRAGRUNT: false
# VALIDATE_TSX: true
# VALIDATE_TYPESCRIPT_ES: true
# VALIDATE_TYPESCRIPT_STANDARD: true
# VALIDATE_XML: true
# VALIDATE_YAML: true
YAML_CONFIG_FILE: /.utils/.github/linters/yamllint.yaml
jobs:
build:
name: Lint Code Base
runs-on: ubuntu-latest-4-cores
timeout-minutes: 90
permissions:
contents: read
statuses: write
steps:
- name: 👀 Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: true
- name: 👀 Checkout utils into subfolder
uses: actions/checkout@v4
with:
persist-credentials: false
repository: swrlab/node-utils
ref: 'main'
path: '.utils'
- name: 🏗 Install Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: 🛠 Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: 📦 Enable Corepack
run: corepack enable
- name: 📦 Install Dependencies (if `install:all`)
if: inputs.install-all == true
run: yarn -v && yarn && yarn install:all
- name: 📦 Install Dependencies (if `install`)
if: inputs.install-all != true
run: yarn install
- name: 🔑 Generate dummy keys
if: inputs.generate-keys == true
run: yarn keys:generate
- name: 📚 Lint Code Base
uses: docker://github/super-linter:v4
with:
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}