forked from oxsecurity/megalinter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-hooks.yaml
66 lines (65 loc) · 2.57 KB
/
.pre-commit-hooks.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
- id: megalinter
name: Run MegaLinter on files modified relative to DEFAULT_BRANCH
entry: npx --
language: system
pass_filenames: false
args:
- mega-linter-runner
- --fix
- --env
- "'APPLY_FIXES=all'"
- --env
- "'FAIL_IF_UPDATED_SOURCES=true'"
- --env
- "'LOG_LEVEL=warning'"
- --env
- "'VALIDATE_ALL_CODEBASE=false'"
- --env
- "'DISABLE_LINTERS=COPYPASTE_JSCPD'"
stages:
- commit
description: >
See https://megalinter.github.io/latest/mega-linter-runner/#usage and
https://megalinter.github.io/latest/configuration/ if you wish to override
the default arguments. mega-linter-runner is specified as an argument so
that you may override the version (e.g., mega-linter-runner@vx.y.z). Depends
on npx, which ships with npm 7+, and Docker. Unlike most pre-commit hooks,
MegaLinter itself computes the files to run on. Runs very slowly when the
pertinent Docker image isn't already cached (c.f.,
https://github.com/marketplace/actions/docker-cache/). If you encounter
permission errors, try running Docker in rootless mode (c.f.,
https://github.com/marketplace/actions/rootless-docker/). Linter results are
logged to the report directory, so you should make sure to list it in your
.gitignore and wipe it between runs. Skip jscpd since duplicate detection
fundamentally requires scanning the entire repository and hence can't be
performed incrementally.
- id: megalinter-all
name: Run MegaLinter on all files
entry: npx --
language: system
pass_filenames: false
args:
- mega-linter-runner
- --fix
- --env
- "'APPLY_FIXES=all'"
- --env
- "'FAIL_IF_UPDATED_SOURCES=true'"
- --env
- "'LOG_LEVEL=warning'"
- --env
- "'VALIDATE_ALL_CODEBASE=true'"
stages:
- push
description: >
See https://megalinter.github.io/latest/mega-linter-runner/#usage and
https://megalinter.github.io/latest/configuration/ if you wish to override
the default arguments. mega-linter-runner is specified as an argument so
that you may override the version (e.g., mega-linter-runner@vx.y.z). Depends
on npx, which ships with npm 7+, and Docker. Runs very slowly when the
pertinent Docker image isn't already cached (c.f.,
https://github.com/marketplace/actions/docker-cache/). If you encounter
permission errors, try running Docker in rootless mode (c.f.,
https://github.com/marketplace/actions/rootless-docker/). Linter results are
logged to the report directory, so you should make sure to list it in your
.gitignore and wipe it between runs.