-
Notifications
You must be signed in to change notification settings - Fork 0
166 lines (158 loc) · 6.14 KB
/
lint.yaml
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
##################
## Super Linter ##
##################
name: Lint
on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
workflow_call:
inputs:
debug:
description: Enaable additional information about the linter, versions, and additional output.
type: boolean
required: false
default: false
log:
description: Create a log file. You can set the log filename using the 'logFile' variable.
type: boolean
required: false
default: false
logFile:
description: The filename for outputting logs, defaults to 'linter.log'. All output is sent to the log file regardless of 'logLevel'.
type: string
required: false
default: 'linter.log'
logLevel:
description: How much output the script will generate to the console. One of ERROR, WARN, NOTICE, VERBOSE, DEBUG or TRACE.
type: string
required: false
default: 'VERBOSE'
linterRules:
description: Directory for all linter configuration rules.
type: string
required: false
default: '.github/linters'
defaultBranch:
description: Default branch of the repo, if not main.
type: string
required: false
default: 'main'
exclude:
description: Regular expression defining which files will be excluded from linting, e.g. `.*src/test.*` (default none).
type: string
required: false
include:
description: Regular expression defining which files will be processed by linters, e.g. `.*src/*` (default all).
type: string
required: false
ignoreGeneratedFiles:
description: If set to true, super-linter will ignore all the files with @generated marker but without @not-generated marker.
type: boolean
required: false
default: false
ignoreGitignoredFiles:
description: If set to true, super-linter will ignore all the files that are ignored by Git.
type: boolean
required: false
default: false
language:
description: Lint language (csharp, cpp, go, actions, etc)
type: string
required: true
jobs:
build:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
# Full git history is needed to get a proper
# list of changed files within `super-linter`
fetch-depth: 0
################################
# Linters
################################
- name: Lint This Repo
if: ${{ github.repository == 'StirlingLabs/Actions' }}
uses: github/super-linter@v4
env:
VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_GITHUB_ACTIONS: true
SUPPRESS_POSSUM: true
- name: Lint Actions
if: inputs.language == 'actions' || inputs.language == 'github-actions'
uses: github/super-linter@v4
env:
VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: ${{ inputs.defaultBranch }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_GITHUB_ACTIONS: true
ACTIONS_RUNNER_DEBUG: ${{ inputs.debug }}
CREATE_LOG_FILE: ${{ inputs.log }}
LOG_FILE: ${{ inputs.logFile }}
LOG_LEVEL: ${{ inputs.logLevel }}
FILTER_REGEX_EXCLUDE: ${{ inputs.exclude }}
FILTER_REGEX_INCLUDE: ${{ inputs.include }}
IGNORE_GENERATED_FILES: ${{ inputs.ignoreGeneratedFiles }}
IGNORE_GITIGNORED_FILES: ${{ inputs.ignoreGitignoredFiles }}
LINTER_RULES_PATH: ${{ inputs.linterRules }}
SUPPRESS_POSSUM: true
- name: Lint C#
if: inputs.language == 'csharp' || inputs.language == 'c#'
uses: github/super-linter@v4
env:
VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: ${{ inputs.defaultBranch }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_CSHARP: true
ACTIONS_RUNNER_DEBUG: ${{ inputs.debug }}
CREATE_LOG_FILE: ${{ inputs.log }}
LOG_FILE: ${{ inputs.logFile }}
LOG_LEVEL: ${{ inputs.logLevel }}
FILTER_REGEX_EXCLUDE: ${{ inputs.exclude }}
FILTER_REGEX_INCLUDE: ${{ inputs.include }}
IGNORE_GENERATED_FILES: ${{ inputs.ignoreGeneratedFiles }}
IGNORE_GITIGNORED_FILES: ${{ inputs.ignoreGitignoredFiles }}
LINTER_RULES_PATH: ${{ inputs.linterRules }}
SUPPRESS_POSSUM: true
- name: Lint C++
if: inputs.language == 'cpp' || inputs.language == 'c++'
uses: github/super-linter@v4
env:
VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: ${{ inputs.defaultBranch }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_CPP: true
ACTIONS_RUNNER_DEBUG: ${{ inputs.debug }}
CREATE_LOG_FILE: ${{ inputs.log }}
LOG_FILE: ${{ inputs.logFile }}
LOG_LEVEL: ${{ inputs.logLevel }}
FILTER_REGEX_EXCLUDE: ${{ inputs.exclude }}
FILTER_REGEX_INCLUDE: ${{ inputs.include }}
IGNORE_GENERATED_FILES: ${{ inputs.ignoreGeneratedFiles }}
IGNORE_GITIGNORED_FILES: ${{ inputs.ignoreGitignoredFiles }}
LINTER_RULES_PATH: ${{ inputs.linterRules }}
SUPPRESS_POSSUM: true
- name: Lint Go
if: inputs.language == 'go'
uses: github/super-linter@v4
env:
VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: ${{ inputs.defaultBranch }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_GO: true
ACTIONS_RUNNER_DEBUG: ${{ inputs.debug }}
CREATE_LOG_FILE: ${{ inputs.log }}
LOG_FILE: ${{ inputs.logFile }}
LOG_LEVEL: ${{ inputs.logLevel }}
FILTER_REGEX_EXCLUDE: ${{ inputs.exclude }}
FILTER_REGEX_INCLUDE: ${{ inputs.include }}
IGNORE_GENERATED_FILES: ${{ inputs.ignoreGeneratedFiles }}
IGNORE_GITIGNORED_FILES: ${{ inputs.ignoreGitignoredFiles }}
LINTER_RULES_PATH: ${{ inputs.linterRules }}
SUPPRESS_POSSUM: true