way_of_working-code_linting-hdi 1.1.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.mega-linter.yml +47 -112
- data/CHANGELOG.md +21 -1
- data/code_safety.yml +37 -41
- data/docs/way_of_working/code-linting/linters.md +40 -32
- data/lib/way_of_working/code_linting/hdi/generators/document_linters.rb +4 -1
- data/lib/way_of_working/code_linting/hdi/generators/exec.rb +2 -2
- data/lib/way_of_working/code_linting/hdi/generators/init_linters.rb +28 -21
- data/lib/way_of_working/code_linting/hdi/templates/.github/workflows/mega-linter.yml +2 -2
- data/lib/way_of_working/code_linting/hdi/templates/.mega-linter.yml +1 -18
- data/lib/way_of_working/code_linting/hdi/templates/docs/way_of_working/code-linting/linters.md.tt +1 -0
- data/lib/way_of_working/code_linting/hdi/templates/eslint.config.js +28 -0
- data/lib/way_of_working/code_linting/hdi/version.rb +1 -1
- metadata +2 -3
- data/lib/way_of_working/code_linting/hdi/templates/.eslintrc.js +0 -20
- data/lib/way_of_working/code_linting/hdi/templates/.github/linters/.markdown-link-check.json +0 -13
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '00395649a4c7df99cfe22542810cad13893e8cd76ec86950b5b1da2a98c39b59'
|
|
4
|
+
data.tar.gz: 21347dfd95053f5bf54ebf3d7055cb88dc0c6d47b74467fe7677b438111172eb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d8688996a550171155fce47aade4cffe3d95abd0cbece30adbe50e716c36d85697efd011127789df1107b74af1e013392d6b4b28c5b9550316bf558017e16882
|
|
7
|
+
data.tar.gz: a80e011c0396dffb11a12df782ead388e96559bf16f60aa53262041fe604c2e959214975efb8796bff5d9756b29ce993ef4abdc25dc3506ffe948b560c370605
|
data/.mega-linter.yml
CHANGED
|
@@ -1,131 +1,58 @@
|
|
|
1
1
|
---
|
|
2
2
|
# Configuration file for MegaLinter
|
|
3
|
-
# See all available variables at https://megalinter.io/configuration/
|
|
3
|
+
# See all available variables at https://megalinter.io/latest/configuration/
|
|
4
4
|
# and in linters documentation
|
|
5
5
|
|
|
6
|
-
APPLY_FIXES: none
|
|
7
|
-
ENABLE_LINTERS:
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
6
|
+
APPLY_FIXES: none # all, none, or list of linter keys
|
|
7
|
+
ENABLE_LINTERS: # All other linters will be disabled by default
|
|
8
|
+
- ACTION_ACTIONLINT
|
|
9
|
+
- API_SPECTRAL
|
|
10
|
+
- ARM_ARM_TTK
|
|
11
|
+
- BASH_EXEC
|
|
12
|
+
- BASH_SHELLCHECK
|
|
13
|
+
- BASH_SHFMT
|
|
14
|
+
- BICEP_BICEP_LINTER
|
|
12
15
|
- C_CLANG_FORMAT
|
|
16
|
+
- C_CPPCHECK
|
|
13
17
|
- C_CPPLINT
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
- COFFEE_COFFEELINT # in Super-Linter
|
|
18
|
+
- CLOUDFORMATION_CFN_LINT
|
|
19
|
+
- COPYPASTE_JSCPD
|
|
17
20
|
- CPP_CLANG_FORMAT
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
- JAVASCRIPT_ES
|
|
29
|
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
21
|
+
- CPP_CPPCHECK
|
|
22
|
+
- CPP_CPPLINT
|
|
23
|
+
- CSS_SCSSLINT
|
|
24
|
+
- CSS_STYLELINT
|
|
25
|
+
- DOCKERFILE_HADOLINT
|
|
26
|
+
- ENV_DOTENV_LINTER
|
|
27
|
+
- GHERKIN_GHERKIN_LINT
|
|
28
|
+
- GRAPHQL_GRAPHQL_SCHEMA_LINTER
|
|
29
|
+
- HTML_DJLINT
|
|
30
|
+
- HTML_HTMLHINT
|
|
31
|
+
- JAVASCRIPT_ES
|
|
32
|
+
- JSON_JSONLINT
|
|
33
|
+
- JSON_NPM_PACKAGE_JSON_LINT
|
|
34
|
+
- JSON_PRETTIER
|
|
35
|
+
- JSON_V8R
|
|
32
36
|
- KOTLIN_DETEKT
|
|
33
|
-
- KOTLIN_KTLINT
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
- MAKEFILE_CHECKMAKE
|
|
38
|
-
# - PERL_PERLCRITIC # in Super-Linter
|
|
39
|
-
# - PHP_BUILTIN
|
|
40
|
-
# - PHP_PHPCS # in Super-Linter
|
|
41
|
-
# - PHP_PHPCSFIXER
|
|
42
|
-
# - PHP_PHPLINT # in Super-Linter
|
|
43
|
-
# - PHP_PHPSTAN # in Super-Linter
|
|
44
|
-
# - PHP_PSALM # in Super-Linter
|
|
45
|
-
# - POWERSHELL_POWERSHELL
|
|
46
|
-
# - POWERSHELL_POWERSHELL_FORMATTER
|
|
37
|
+
- KOTLIN_KTLINT
|
|
38
|
+
- MARKDOWN_MARKDOWN_TABLE_FORMATTER
|
|
39
|
+
- MARKDOWN_MARKDOWNLINT
|
|
40
|
+
- PROTOBUF_PROTOLINT
|
|
47
41
|
- PYTHON_BANDIT
|
|
48
|
-
- PYTHON_BLACK
|
|
49
|
-
- PYTHON_FLAKE8
|
|
50
|
-
- PYTHON_ISORT
|
|
42
|
+
- PYTHON_BLACK
|
|
43
|
+
- PYTHON_FLAKE8
|
|
44
|
+
- PYTHON_ISORT
|
|
51
45
|
- PYTHON_MYPY
|
|
52
|
-
- PYTHON_PYLINT
|
|
46
|
+
- PYTHON_PYLINT
|
|
53
47
|
- PYTHON_PYRIGHT
|
|
54
48
|
- PYTHON_RUFF
|
|
55
|
-
-
|
|
56
|
-
|
|
57
|
-
# - RUBY_RUBOCOP # in Super-Linter
|
|
58
|
-
- RUST_CLIPPY # in Super-Linter
|
|
59
|
-
# - SALESFORCE_LIGHTNING_FLOW_SCANNER
|
|
60
|
-
# - SALESFORCE_SFDX_SCANNER_APEX
|
|
61
|
-
# - SALESFORCE_SFDX_SCANNER_AURA
|
|
62
|
-
# - SALESFORCE_SFDX_SCANNER_LWC
|
|
63
|
-
- SCALA_SCALAFIX
|
|
64
|
-
- SQL_SQLFLUFF # in Super-Linter
|
|
65
|
-
- SQL_TSQLLINT
|
|
66
|
-
- SWIFT_SWIFTLINT
|
|
67
|
-
- TSX_ESLINT
|
|
68
|
-
- TYPESCRIPT_ES # in Super-Linter
|
|
69
|
-
# - TYPESCRIPT_PRETTIER
|
|
70
|
-
- TYPESCRIPT_STANDARD # in Super-Linter
|
|
71
|
-
# - VBDOTNET_DOTNET_FORMAT
|
|
72
|
-
|
|
73
|
-
### Formats
|
|
74
|
-
- CSS_STYLELINT # in Super-Linter
|
|
75
|
-
- ENV_DOTENV_LINTER # in Super-Linter
|
|
76
|
-
# - GRAPHQL_GRAPHQL_SCHEMA_LINTER
|
|
77
|
-
# - HTML_DJLINT # Refuses to see config file
|
|
78
|
-
- HTML_HTMLHINT # in Super-Linter
|
|
79
|
-
- JSON_ESLINT_PLUGIN_JSONC # in Super-Linter
|
|
80
|
-
- JSON_JSONLINT
|
|
81
|
-
- JSON_NPM_PACKAGE_JSON_LINT
|
|
82
|
-
# - JSON_PRETTIER
|
|
83
|
-
- JSON_V8R
|
|
84
|
-
# - LATEX_CHKTEX # in Super-Linter
|
|
85
|
-
- MARKDOWN_MARKDOWNLINT # in Super-Linter
|
|
86
|
-
- MARKDOWN_MARKDOWN_LINK_CHECK
|
|
87
|
-
- MARKDOWN_MARKDOWN_TABLE_FORMATTER
|
|
88
|
-
- MARKDOWN_REMARK_LINT
|
|
89
|
-
# - PROTOBUF_PROTOLINT # in Super-Linter
|
|
90
|
-
# - RST_RSTCHECK
|
|
91
|
-
# - RST_RSTFMT
|
|
92
|
-
# - RST_RST_LINT
|
|
93
|
-
- XML_XMLLINT # in Super-Linter
|
|
94
|
-
# - YAML_PRETTIER
|
|
95
|
-
- YAML_V8R
|
|
96
|
-
- YAML_YAMLLINT # in Super-Linter
|
|
97
|
-
|
|
98
|
-
### Tooling
|
|
99
|
-
- ACTION_ACTIONLINT # in Super-Linter
|
|
100
|
-
- ANSIBLE_ANSIBLE_LINT # in Super-Linter
|
|
101
|
-
- API_SPECTRAL
|
|
102
|
-
- ARM_ARM_TTK # in Super-Linter
|
|
103
|
-
# - BICEP_BICEP_LINTER
|
|
104
|
-
- CLOUDFORMATION_CFN_LINT # in Super-Linter
|
|
105
|
-
- DOCKERFILE_HADOLINT # in Super-Linter
|
|
106
|
-
- EDITORCONFIG_EDITORCONFIG_CHECKER # in Super-Linter
|
|
107
|
-
# - GHERKIN_GHERKIN_LINT # in Super-Linter
|
|
108
|
-
- KUBERNETES_HELM
|
|
109
|
-
- KUBERNETES_KUBECONFORM
|
|
110
|
-
- KUBERNETES_KUBESCAPE
|
|
111
|
-
- PUPPET_PUPPET_LINT
|
|
112
|
-
# - SNAKEMAKE_LINT # in Super-Linter
|
|
113
|
-
# - SNAKEMAKE_SNAKEFMT # in Super-Linter
|
|
114
|
-
# - TEKTON_TEKTON_LINT # in Super-Linter
|
|
115
|
-
- TERRAFORM_TERRAFORM_FMT # in Super-Linter
|
|
116
|
-
- TERRAFORM_TERRAGRUNT # in Super-Linter
|
|
117
|
-
- TERRAFORM_TERRASCAN # in Super-Linter
|
|
118
|
-
- TERRAFORM_TFLINT # in Super-Linter
|
|
119
|
-
|
|
120
|
-
### Code quality checkers
|
|
121
|
-
- COPYPASTE_JSCPD # in Super-Linter
|
|
49
|
+
- PYTHON_RUFF_FORMAT
|
|
50
|
+
- R_LINTR
|
|
122
51
|
- REPOSITORY_CHECKOV
|
|
123
52
|
- REPOSITORY_DEVSKIM
|
|
124
53
|
- REPOSITORY_DUSTILOCK
|
|
125
54
|
- REPOSITORY_GIT_DIFF
|
|
126
|
-
- REPOSITORY_GITLEAKS # in Super-Linter
|
|
127
55
|
- REPOSITORY_GRYPE
|
|
128
|
-
- REPOSITORY_KICS
|
|
129
56
|
- REPOSITORY_LS_LINT
|
|
130
57
|
- REPOSITORY_SECRETLINT
|
|
131
58
|
- REPOSITORY_SEMGREP
|
|
@@ -133,10 +60,18 @@ ENABLE_LINTERS: # All other linters will be disabled by default
|
|
|
133
60
|
- REPOSITORY_TRIVY
|
|
134
61
|
- REPOSITORY_TRIVY_SBOM
|
|
135
62
|
- REPOSITORY_TRUFFLEHOG
|
|
136
|
-
# - SPELL_CSPELL
|
|
137
63
|
- SPELL_LYCHEE
|
|
138
64
|
- SPELL_PROSELINT
|
|
139
65
|
- SPELL_VALE
|
|
66
|
+
- SQL_SQLFLUFF
|
|
67
|
+
- SWIFT_SWIFTLINT
|
|
68
|
+
- TERRAFORM_TERRAFORM_FMT
|
|
69
|
+
- TERRAFORM_TERRAGRUNT
|
|
70
|
+
- TERRAFORM_TFLINT
|
|
71
|
+
- XML_XMLLINT
|
|
72
|
+
- YAML_PRETTIER
|
|
73
|
+
- YAML_V8R
|
|
74
|
+
- YAML_YAMLLINT
|
|
140
75
|
|
|
141
76
|
SHOW_ELAPSED_TIME: false
|
|
142
77
|
FILEIO_REPORTER: false
|
data/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
8
8
|
|
|
9
9
|
## [Unreleased]
|
|
10
10
|
|
|
11
|
+
## [1.2.0] - 2026-11-16
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- JavaScript projects get `npm run lint` and `npm run lint:fix` scripts in `package.json` (#14)
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- Replaced the `.eslintrc.js` and `.eslintignore` templates with an ESLint flat config (`eslint.config.js`) using neostandard, as MegaLinter's bundled ESLint no longer reads legacy config; MegaLinter now runs the project's own eslint
|
|
20
|
+
- Removed linters that MegaLinter no longer ships from the `.mega-linter.yml` template; their replacements (e.g. `REPOSITORY_SECRETLINT`, `REPOSITORY_CHECKOV`, `REPOSITORY_GIT_DIFF`, `SPELL_LYCHEE`) were already enabled
|
|
21
|
+
|
|
22
|
+
### Removed
|
|
23
|
+
|
|
24
|
+
- The `.github/linters/.markdown-link-check.json` template, as MegaLinter no longer ships markdown-link-check; the generator now deletes it from existing projects
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
|
|
28
|
+
- MegaLinter no longer runs out of runner disk space: the HDI custom flavor action now frees space before pulling its image (HealthDataInsight/megalinter-custom-flavor-hdi#2)
|
|
29
|
+
|
|
11
30
|
## [1.1.2] - 2026-06-08
|
|
12
31
|
|
|
13
32
|
### Changed
|
|
@@ -43,7 +62,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
43
62
|
- Added MegaLinter for linting common file formats with generator command and rake task
|
|
44
63
|
- Added a GitHub audit rule to check that linting is used and configured correctly
|
|
45
64
|
|
|
46
|
-
[unreleased]: https://github.com/HealthDataInsight/way_of_working-code_linting-hdi/compare/v1.
|
|
65
|
+
[unreleased]: https://github.com/HealthDataInsight/way_of_working-code_linting-hdi/compare/v1.2.0...HEAD
|
|
66
|
+
[1.2.0]: https://github.com/HealthDataInsight/way_of_working-code_linting-hdi/compare/v1.1.2...v1.2.0
|
|
47
67
|
[1.1.2]: https://github.com/HealthDataInsight/way_of_working-code_linting-hdi/compare/v1.1.1...v1.1.2
|
|
48
68
|
[1.1.1]: https://github.com/HealthDataInsight/way_of_working-code_linting-hdi/compare/v1.0.0...v1.1.1
|
|
49
69
|
[1.1.0]: https://github.com/HealthDataInsight/way_of_working-code_linting-hdi/compare/v1.0.0...v1.1.0
|
data/code_safety.yml
CHANGED
|
@@ -8,50 +8,50 @@ file safety:
|
|
|
8
8
|
comments:
|
|
9
9
|
reviewed_by: timgentry
|
|
10
10
|
safe_revision: 82687366222b885cbc41449f5bbd30fe9440cd4c
|
|
11
|
-
".github/linters/.markdown-link-check.json":
|
|
12
|
-
comments:
|
|
13
|
-
reviewed_by: timgentry
|
|
14
|
-
safe_revision: 9c246b038991ac78d79effd5f960e90a6a3e4547
|
|
15
11
|
".github/linters/rubocop_defaults.yml":
|
|
16
12
|
comments:
|
|
17
13
|
reviewed_by: shilpigoeldev
|
|
18
14
|
safe_revision: b89ef4afd67d02b6f6ff323bb9accde2dcf2686d
|
|
15
|
+
".github/pull_request_template.md":
|
|
16
|
+
comments:
|
|
17
|
+
reviewed_by: shilpigoeldev
|
|
18
|
+
safe_revision: 02e7399e8afb0e9de8514d372642192d090c76f1
|
|
19
19
|
".github/workflows/inclusive-language.yml":
|
|
20
20
|
comments:
|
|
21
|
-
reviewed_by:
|
|
22
|
-
safe_revision:
|
|
21
|
+
reviewed_by: shilpigoeldev
|
|
22
|
+
safe_revision: 8bbae38daf2f7409e817e336db38bb71baaa9220
|
|
23
23
|
".github/workflows/main.yml":
|
|
24
24
|
comments:
|
|
25
|
-
reviewed_by:
|
|
26
|
-
safe_revision:
|
|
25
|
+
reviewed_by: shilpigoeldev
|
|
26
|
+
safe_revision: 8bbae38daf2f7409e817e336db38bb71baaa9220
|
|
27
27
|
".github/workflows/mega-linter.yml":
|
|
28
28
|
comments:
|
|
29
|
-
reviewed_by:
|
|
30
|
-
safe_revision:
|
|
29
|
+
reviewed_by: shilpigoeldev
|
|
30
|
+
safe_revision: 8bbae38daf2f7409e817e336db38bb71baaa9220
|
|
31
31
|
".gitignore":
|
|
32
32
|
comments:
|
|
33
33
|
reviewed_by: timgentry
|
|
34
34
|
safe_revision: 82687366222b885cbc41449f5bbd30fe9440cd4c
|
|
35
35
|
".mega-linter.yml":
|
|
36
36
|
comments:
|
|
37
|
-
reviewed_by:
|
|
38
|
-
safe_revision:
|
|
37
|
+
reviewed_by: shilpigoeldev
|
|
38
|
+
safe_revision: 8bbae38daf2f7409e817e336db38bb71baaa9220
|
|
39
39
|
".rubocop":
|
|
40
40
|
comments:
|
|
41
41
|
reviewed_by: shilpigoeldev
|
|
42
42
|
safe_revision: b89ef4afd67d02b6f6ff323bb9accde2dcf2686d
|
|
43
43
|
CHANGELOG.md:
|
|
44
44
|
comments:
|
|
45
|
-
reviewed_by:
|
|
46
|
-
safe_revision:
|
|
45
|
+
reviewed_by: shilpigoeldev
|
|
46
|
+
safe_revision: a44710c9aa2ed7acdcdfcf36d33988c105390e9a
|
|
47
47
|
Gemfile:
|
|
48
48
|
comments:
|
|
49
|
-
reviewed_by:
|
|
50
|
-
safe_revision:
|
|
49
|
+
reviewed_by: shilpigoeldev
|
|
50
|
+
safe_revision: 02e7399e8afb0e9de8514d372642192d090c76f1
|
|
51
51
|
Gemfile.lock:
|
|
52
52
|
comments:
|
|
53
|
-
reviewed_by:
|
|
54
|
-
safe_revision:
|
|
53
|
+
reviewed_by: shilpigoeldev
|
|
54
|
+
safe_revision: a44710c9aa2ed7acdcdfcf36d33988c105390e9a
|
|
55
55
|
LICENSE.txt:
|
|
56
56
|
comments:
|
|
57
57
|
reviewed_by: shilpigoeldev
|
|
@@ -78,8 +78,8 @@ file safety:
|
|
|
78
78
|
safe_revision: 9c246b038991ac78d79effd5f960e90a6a3e4547
|
|
79
79
|
docs/way_of_working/code-linting/linters.md:
|
|
80
80
|
comments:
|
|
81
|
-
reviewed_by:
|
|
82
|
-
safe_revision:
|
|
81
|
+
reviewed_by: shilpigoeldev
|
|
82
|
+
safe_revision: 02e7399e8afb0e9de8514d372642192d090c76f1
|
|
83
83
|
lib/way_of_working/code_linting/hdi.rb:
|
|
84
84
|
comments:
|
|
85
85
|
reviewed_by: timgentry
|
|
@@ -90,12 +90,12 @@ file safety:
|
|
|
90
90
|
safe_revision: 82687366222b885cbc41449f5bbd30fe9440cd4c
|
|
91
91
|
lib/way_of_working/code_linting/hdi/generators/document_linters.rb:
|
|
92
92
|
comments:
|
|
93
|
-
reviewed_by:
|
|
94
|
-
safe_revision:
|
|
93
|
+
reviewed_by: shilpigoeldev
|
|
94
|
+
safe_revision: 0fde84514a7cb77b5f887483c8856666158c6f62
|
|
95
95
|
lib/way_of_working/code_linting/hdi/generators/exec.rb:
|
|
96
96
|
comments:
|
|
97
97
|
reviewed_by: shilpigoeldev
|
|
98
|
-
safe_revision:
|
|
98
|
+
safe_revision: 02e7399e8afb0e9de8514d372642192d090c76f1
|
|
99
99
|
lib/way_of_working/code_linting/hdi/generators/init.rb:
|
|
100
100
|
comments:
|
|
101
101
|
reviewed_by: shilpigoeldev
|
|
@@ -103,7 +103,7 @@ file safety:
|
|
|
103
103
|
lib/way_of_working/code_linting/hdi/generators/init_linters.rb:
|
|
104
104
|
comments:
|
|
105
105
|
reviewed_by: shilpigoeldev
|
|
106
|
-
safe_revision:
|
|
106
|
+
safe_revision: 8bbae38daf2f7409e817e336db38bb71baaa9220
|
|
107
107
|
lib/way_of_working/code_linting/hdi/github_audit_rule.rb:
|
|
108
108
|
comments:
|
|
109
109
|
reviewed_by: shilpigoeldev
|
|
@@ -120,26 +120,18 @@ file safety:
|
|
|
120
120
|
comments:
|
|
121
121
|
reviewed_by: shilpigoeldev
|
|
122
122
|
safe_revision: 0c7aeda9a9a90b16cea0f1921e29b21d4f27e5ac
|
|
123
|
-
lib/way_of_working/code_linting/hdi/templates/.eslintrc.js:
|
|
124
|
-
comments:
|
|
125
|
-
reviewed_by: timgentry
|
|
126
|
-
safe_revision: 8452b01ebb948e84ea0c8389da0187571ca48dbb
|
|
127
|
-
lib/way_of_working/code_linting/hdi/templates/.github/linters/.markdown-link-check.json:
|
|
128
|
-
comments:
|
|
129
|
-
reviewed_by: timgentry
|
|
130
|
-
safe_revision: 2af6973c231a711ae512dc2d3bd3280b11382d6c
|
|
131
123
|
lib/way_of_working/code_linting/hdi/templates/.github/linters/rubocop_defaults.yml:
|
|
132
124
|
comments:
|
|
133
125
|
reviewed_by: shilpigoeldev
|
|
134
126
|
safe_revision: 0c7aeda9a9a90b16cea0f1921e29b21d4f27e5ac
|
|
135
127
|
lib/way_of_working/code_linting/hdi/templates/.github/workflows/mega-linter.yml:
|
|
136
128
|
comments:
|
|
137
|
-
reviewed_by:
|
|
138
|
-
safe_revision:
|
|
129
|
+
reviewed_by: shilpigoeldev
|
|
130
|
+
safe_revision: 8bbae38daf2f7409e817e336db38bb71baaa9220
|
|
139
131
|
lib/way_of_working/code_linting/hdi/templates/.mega-linter.yml:
|
|
140
132
|
comments:
|
|
141
|
-
reviewed_by:
|
|
142
|
-
safe_revision:
|
|
133
|
+
reviewed_by: shilpigoeldev
|
|
134
|
+
safe_revision: 8bbae38daf2f7409e817e336db38bb71baaa9220
|
|
143
135
|
lib/way_of_working/code_linting/hdi/templates/.rubocop:
|
|
144
136
|
comments:
|
|
145
137
|
reviewed_by: shilpigoeldev
|
|
@@ -151,11 +143,15 @@ file safety:
|
|
|
151
143
|
lib/way_of_working/code_linting/hdi/templates/docs/way_of_working/code-linting/linters.md.tt:
|
|
152
144
|
comments:
|
|
153
145
|
reviewed_by: shilpigoeldev
|
|
154
|
-
safe_revision:
|
|
146
|
+
safe_revision: 0fde84514a7cb77b5f887483c8856666158c6f62
|
|
147
|
+
lib/way_of_working/code_linting/hdi/templates/eslint.config.js:
|
|
148
|
+
comments:
|
|
149
|
+
reviewed_by: shilpigoeldev
|
|
150
|
+
safe_revision: 02e7399e8afb0e9de8514d372642192d090c76f1
|
|
155
151
|
lib/way_of_working/code_linting/hdi/version.rb:
|
|
156
152
|
comments:
|
|
157
|
-
reviewed_by:
|
|
158
|
-
safe_revision:
|
|
153
|
+
reviewed_by: shilpigoeldev
|
|
154
|
+
safe_revision: a44710c9aa2ed7acdcdfcf36d33988c105390e9a
|
|
159
155
|
test/resources/XcodeApp.xcodeproj/project.pbxproj:
|
|
160
156
|
comments:
|
|
161
157
|
reviewed_by: shilpigoeldev
|
|
@@ -167,7 +163,7 @@ file safety:
|
|
|
167
163
|
test/way_of_working/code_linting/hdi/generators/document_linters_test.rb:
|
|
168
164
|
comments:
|
|
169
165
|
reviewed_by: shilpigoeldev
|
|
170
|
-
safe_revision:
|
|
166
|
+
safe_revision: 02e7399e8afb0e9de8514d372642192d090c76f1
|
|
171
167
|
test/way_of_working/code_linting/hdi/generators/exec_test.rb:
|
|
172
168
|
comments:
|
|
173
169
|
reviewed_by: timgentry
|
|
@@ -175,7 +171,7 @@ file safety:
|
|
|
175
171
|
test/way_of_working/code_linting/hdi/generators/init_linters_test.rb:
|
|
176
172
|
comments:
|
|
177
173
|
reviewed_by: shilpigoeldev
|
|
178
|
-
safe_revision:
|
|
174
|
+
safe_revision: 8bbae38daf2f7409e817e336db38bb71baaa9220
|
|
179
175
|
test/way_of_working/code_linting/hdi/github_audit_rule_test.rb:
|
|
180
176
|
comments:
|
|
181
177
|
reviewed_by: timgentry
|
|
@@ -33,16 +33,16 @@ The following tables detail the linters that we are currently using:
|
|
|
33
33
|
| Groovy | ~~GROOVY_NPM_GROOVY_LINT~~ | Not Used |
|
|
34
34
|
| Java | ~~JAVA_CHECKSTYLE~~ | Not Used |
|
|
35
35
|
| Java | ~~JAVA_PMD~~ | Not Used |
|
|
36
|
+
| JavaScript | ~~JAVASCRIPT_BIOME~~ | Not Used |
|
|
36
37
|
| JavaScript | JAVASCRIPT_ES | [eslint](https://megalinter.io/latest/descriptors/javascript_eslint/) |
|
|
37
38
|
| JavaScript | ~~JAVASCRIPT_PRETTIER~~ | Not Used |
|
|
38
39
|
| JavaScript | ~~JAVASCRIPT_STANDARD~~ | Not Used |
|
|
40
|
+
| JSX | ~~JSX_BIOME~~ | Not Used |
|
|
39
41
|
| JSX | ~~JSX_ESLINT~~ | Not Used |
|
|
40
42
|
| Kotlin | KOTLIN_DETEKT | [detekt](https://megalinter.io/latest/descriptors/kotlin_detekt/) |
|
|
41
43
|
| Kotlin | KOTLIN_KTLINT | [ktlint](https://megalinter.io/latest/descriptors/kotlin_ktlint/) |
|
|
42
44
|
| Lua | ~~LUA_LUACHECK~~ | Not Used |
|
|
43
|
-
| Lua | ~~LUA_SELENE~~ | Not Used |
|
|
44
45
|
| Lua | ~~LUA_STYLUA~~ | Not Used |
|
|
45
|
-
| Makefile | MAKEFILE_CHECKMAKE | [checkmake](https://megalinter.io/latest/descriptors/makefile_checkmake/) |
|
|
46
46
|
| Perl | ~~PERL_PERLCRITIC~~ | Not Used |
|
|
47
47
|
| PHP | ~~PHP_PHPCS~~ | Not Used |
|
|
48
48
|
| PHP | ~~PHP_PHPCSFIXER~~ | Not Used |
|
|
@@ -56,6 +56,7 @@ The following tables detail the linters that we are currently using:
|
|
|
56
56
|
| Python | PYTHON_FLAKE8 | [flake8](https://megalinter.io/latest/descriptors/python_flake8/) |
|
|
57
57
|
| Python | PYTHON_ISORT | [isort](https://megalinter.io/latest/descriptors/python_isort/) |
|
|
58
58
|
| Python | PYTHON_MYPY | [mypy](https://megalinter.io/latest/descriptors/python_mypy/) |
|
|
59
|
+
| Python | ~~PYTHON_NBQA_MYPY~~ | Not Used |
|
|
59
60
|
| Python | PYTHON_PYLINT | [pylint](https://megalinter.io/latest/descriptors/python_pylint/) |
|
|
60
61
|
| Python | PYTHON_PYRIGHT | [pyright](https://megalinter.io/latest/descriptors/python_pyright/) |
|
|
61
62
|
| Python | PYTHON_RUFF | [ruff](https://megalinter.io/latest/descriptors/python_ruff/) |
|
|
@@ -64,15 +65,17 @@ The following tables detail the linters that we are currently using:
|
|
|
64
65
|
| Raku | ~~RAKU_RAKU~~ | Not Used |
|
|
65
66
|
| Ruby | ~~RUBY_RUBOCOP~~ | Not Used (RuboCop is used directly) |
|
|
66
67
|
| Rust | ~~RUST_CLIPPY~~ | Not Used |
|
|
67
|
-
| Salesforce | ~~
|
|
68
|
-
| Salesforce | ~~
|
|
69
|
-
| Salesforce | ~~
|
|
70
|
-
| Salesforce | ~~
|
|
68
|
+
| Salesforce | ~~SALESFORCE_CODE_ANALYZER_APEX~~ | Not Used |
|
|
69
|
+
| Salesforce | ~~SALESFORCE_CODE_ANALYZER_APEXGURU~~ | Not Used |
|
|
70
|
+
| Salesforce | ~~SALESFORCE_CODE_ANALYZER_AURA~~ | Not Used |
|
|
71
|
+
| Salesforce | ~~SALESFORCE_CODE_ANALYZER_FLOW~~ | Not Used |
|
|
72
|
+
| Salesforce | ~~SALESFORCE_CODE_ANALYZER_LWC~~ | Not Used |
|
|
71
73
|
| Scala | ~~SCALA_SCALAFIX~~ | Not Used |
|
|
72
74
|
| SQL | SQL_SQLFLUFF | [sqlfluff](https://megalinter.io/latest/descriptors/sql_sqlfluff/) |
|
|
73
|
-
| SQL | SQL_TSQLLINT | [tsqllint](https://megalinter.io/latest/descriptors/sql_tsqllint/) |
|
|
74
75
|
| Swift | SWIFT_SWIFTLINT | [swiftlint](https://megalinter.io/latest/descriptors/swift_swiftlint/) |
|
|
76
|
+
| TSX | ~~TSX_BIOME~~ | Not Used |
|
|
75
77
|
| TSX | ~~TSX_ESLINT~~ | Not Used |
|
|
78
|
+
| TypeScript | ~~TYPESCRIPT_BIOME~~ | Not Used |
|
|
76
79
|
| TypeScript | ~~TYPESCRIPT_ES~~ | Not Used |
|
|
77
80
|
| TypeScript | ~~TYPESCRIPT_PRETTIER~~ | Not Used |
|
|
78
81
|
| TypeScript | ~~TYPESCRIPT_STANDARD~~ | Not Used |
|
|
@@ -82,12 +85,14 @@ The following tables detail the linters that we are currently using:
|
|
|
82
85
|
|
|
83
86
|
| Format | Linter | Details |
|
|
84
87
|
|:-----------------|:----------------------------------|:--------------------------------------------------------------------------------------------------------|
|
|
88
|
+
| CSS | ~~CSS_BIOME~~ | Not Used |
|
|
85
89
|
| CSS | CSS_STYLELINT | [stylelint](https://megalinter.io/latest/descriptors/css_stylelint/) |
|
|
86
90
|
| ENV | ENV_DOTENV_LINTER | [dotenv-linter](https://megalinter.io/latest/descriptors/env_dotenv_linter/) |
|
|
91
|
+
| GraphQL | ~~GRAPHQL_BIOME~~ | Not Used |
|
|
87
92
|
| GraphQL | GRAPHQL_GRAPHQL_SCHEMA_LINTER | [graphql-schema-linter](https://megalinter.io/latest/descriptors/graphql_graphql_schema_linter/) |
|
|
88
93
|
| HTML | HTML_DJLINT | [djlint](https://megalinter.io/latest/descriptors/html_djlint/) |
|
|
89
94
|
| HTML | HTML_HTMLHINT | [htmlhint](https://megalinter.io/latest/descriptors/html_htmlhint/) |
|
|
90
|
-
| JSON |
|
|
95
|
+
| JSON | ~~JSON_BIOME~~ | Not Used |
|
|
91
96
|
| JSON | JSON_JSONLINT | [jsonlint](https://megalinter.io/latest/descriptors/json_jsonlint/) |
|
|
92
97
|
| JSON | JSON_NPM_PACKAGE_JSON_LINT | [npm-package-json-lint](https://megalinter.io/latest/descriptors/json_npm_package_json_lint/) |
|
|
93
98
|
| JSON | JSON_PRETTIER | [prettier](https://megalinter.io/latest/descriptors/json_prettier/) |
|
|
@@ -95,7 +100,7 @@ The following tables detail the linters that we are currently using:
|
|
|
95
100
|
| LaTeX | ~~LATEX_CHKTEX~~ | Not Used |
|
|
96
101
|
| Markdown | MARKDOWN_MARKDOWNLINT | [markdownlint](https://megalinter.io/latest/descriptors/markdown_markdownlint/) |
|
|
97
102
|
| Markdown | MARKDOWN_MARKDOWN_TABLE_FORMATTER | [markdown-table-formatter](https://megalinter.io/latest/descriptors/markdown_markdown_table_formatter/) |
|
|
98
|
-
| Markdown |
|
|
103
|
+
| Markdown | ~~MARKDOWN_RUMDL~~ | Not Used |
|
|
99
104
|
| Protocol Buffers | PROTOBUF_PROTOLINT | [protolint](https://megalinter.io/latest/descriptors/protobuf_protolint/) |
|
|
100
105
|
| reStructuredText | ~~RST_RSTCHECK~~ | Not Used |
|
|
101
106
|
| reStructuredText | ~~RST_RSTFMT~~ | Not Used |
|
|
@@ -110,6 +115,7 @@ The following tables detail the linters that we are currently using:
|
|
|
110
115
|
| Tooling format | Linter | Details |
|
|
111
116
|
|:---------------|:--------------------------------------|:-----------------------------------------------------------------------------------|
|
|
112
117
|
| GitHub Action | ACTION_ACTIONLINT | [actionlint](https://megalinter.io/latest/descriptors/action_actionlint/) |
|
|
118
|
+
| GitHub Action | ~~ACTION_ZIZMOR~~ | Not Used |
|
|
113
119
|
| Ansible | ~~ANSIBLE_ANSIBLE_LINT~~ | Not Used |
|
|
114
120
|
| Api | API_SPECTRAL | [spectral](https://megalinter.io/latest/descriptors/api_spectral/) |
|
|
115
121
|
| ARM Templates | ARM_ARM_TTK | [arm-ttk](https://megalinter.io/latest/descriptors/arm_arm_ttk/) |
|
|
@@ -121,36 +127,38 @@ The following tables detail the linters that we are currently using:
|
|
|
121
127
|
| Kubernetes | ~~KUBERNETES_HELM~~ | Not Used |
|
|
122
128
|
| Kubernetes | ~~KUBERNETES_KUBECONFORM~~ | Not Used |
|
|
123
129
|
| Kubernetes | ~~KUBERNETES_KUBESCAPE~~ | Not Used |
|
|
124
|
-
| Puppet | ~~PUPPET_PUPPET_LINT~~ | Not Used |
|
|
125
130
|
| Robotframework | ~~ROBOTFRAMEWORK_ROBOCOP~~ | Not Used |
|
|
126
131
|
| Snakemake | ~~SNAKEMAKE_LINT~~ | Not Used |
|
|
127
132
|
| Snakemake | ~~SNAKEMAKE_SNAKEFMT~~ | Not Used |
|
|
128
133
|
| Tekton | ~~TEKTON_TEKTON_LINT~~ | Not Used |
|
|
129
134
|
| Terraform | TERRAFORM_TERRAFORM_FMT | [terraform-fmt](https://megalinter.io/latest/descriptors/terraform_terraform_fmt/) |
|
|
130
135
|
| Terraform | TERRAFORM_TERRAGRUNT | [terragrunt](https://megalinter.io/latest/descriptors/terraform_terragrunt/) |
|
|
131
|
-
| Terraform | TERRAFORM_TERRASCAN | [terrascan](https://megalinter.io/latest/descriptors/terraform_terrascan/) |
|
|
132
136
|
| Terraform | TERRAFORM_TFLINT | [tflint](https://megalinter.io/latest/descriptors/terraform_tflint/) |
|
|
137
|
+
| Terraform | ~~TERRAFORM_TOFU_FMT~~ | Not Used |
|
|
138
|
+
| Terraform | ~~TERRAFORM_TOFU_VALIDATE~~ | Not Used |
|
|
133
139
|
|
|
134
140
|
## Other
|
|
135
141
|
|
|
136
|
-
| Other | Linter
|
|
137
|
-
|
|
138
|
-
| Copypaste | COPYPASTE_JSCPD
|
|
139
|
-
| Repository |
|
|
140
|
-
| Repository |
|
|
141
|
-
| Repository |
|
|
142
|
-
| Repository |
|
|
143
|
-
| Repository | REPOSITORY_GIT_DIFF
|
|
144
|
-
| Repository | REPOSITORY_GRYPE
|
|
145
|
-
| Repository |
|
|
146
|
-
| Repository | REPOSITORY_LS_LINT
|
|
147
|
-
| Repository |
|
|
148
|
-
| Repository |
|
|
149
|
-
| Repository |
|
|
150
|
-
| Repository |
|
|
151
|
-
| Repository |
|
|
152
|
-
| Repository |
|
|
153
|
-
|
|
|
154
|
-
| Spelling |
|
|
155
|
-
| Spelling |
|
|
156
|
-
| Spelling |
|
|
142
|
+
| Other | Linter | Details |
|
|
143
|
+
|:-----------|:---------------------------|:------------------------------------------------------------------------------|
|
|
144
|
+
| Copypaste | COPYPASTE_JSCPD | [jscpd](https://megalinter.io/latest/descriptors/copypaste_jscpd/) |
|
|
145
|
+
| Repository | ~~REPOSITORY_BETTERLEAKS~~ | Not Used |
|
|
146
|
+
| Repository | REPOSITORY_CHECKOV | [checkov](https://megalinter.io/latest/descriptors/repository_checkov/) |
|
|
147
|
+
| Repository | REPOSITORY_DEVSKIM | [devskim](https://megalinter.io/latest/descriptors/repository_devskim/) |
|
|
148
|
+
| Repository | REPOSITORY_DUSTILOCK | [dustilock](https://megalinter.io/latest/descriptors/repository_dustilock/) |
|
|
149
|
+
| Repository | REPOSITORY_GIT_DIFF | [git_diff](https://megalinter.io/latest/descriptors/repository_git_diff/) |
|
|
150
|
+
| Repository | REPOSITORY_GRYPE | [grype](https://megalinter.io/latest/descriptors/repository_grype/) |
|
|
151
|
+
| Repository | ~~REPOSITORY_KINGFISHER~~ | Not Used |
|
|
152
|
+
| Repository | REPOSITORY_LS_LINT | [ls-lint](https://megalinter.io/latest/descriptors/repository_ls_lint/) |
|
|
153
|
+
| Repository | ~~REPOSITORY_OSV_SCANNER~~ | Not Used |
|
|
154
|
+
| Repository | REPOSITORY_SECRETLINT | [secretlint](https://megalinter.io/latest/descriptors/repository_secretlint/) |
|
|
155
|
+
| Repository | REPOSITORY_SEMGREP | [semgrep](https://megalinter.io/latest/descriptors/repository_semgrep/) |
|
|
156
|
+
| Repository | REPOSITORY_SYFT | [syft](https://megalinter.io/latest/descriptors/repository_syft/) |
|
|
157
|
+
| Repository | REPOSITORY_TRIVY | [trivy](https://megalinter.io/latest/descriptors/repository_trivy/) |
|
|
158
|
+
| Repository | REPOSITORY_TRIVY_SBOM | [trivy-sbom](https://megalinter.io/latest/descriptors/repository_trivy_sbom/) |
|
|
159
|
+
| Repository | REPOSITORY_TRUFFLEHOG | [trufflehog](https://megalinter.io/latest/descriptors/repository_trufflehog/) |
|
|
160
|
+
| Spelling | ~~SPELL_CODESPELL~~ | Not Used |
|
|
161
|
+
| Spelling | ~~SPELL_CSPELL~~ | Not Used |
|
|
162
|
+
| Spelling | SPELL_LYCHEE | [lychee](https://megalinter.io/latest/descriptors/spell_lychee/) |
|
|
163
|
+
| Spelling | SPELL_PROSELINT | [proselint](https://megalinter.io/latest/descriptors/spell_proselint/) |
|
|
164
|
+
| Spelling | SPELL_VALE | [vale](https://megalinter.io/latest/descriptors/spell_vale/) |
|
|
@@ -29,6 +29,9 @@ module WayOfWorking
|
|
|
29
29
|
|
|
30
30
|
# Iterate over each linter type in the parsed HTML
|
|
31
31
|
parse_linter_types_html do |type, html_rows|
|
|
32
|
+
# Scraped page adds heading-only sections (e.g. "Comments") with no table
|
|
33
|
+
next if html_rows.empty?
|
|
34
|
+
|
|
32
35
|
@types[type] = []
|
|
33
36
|
|
|
34
37
|
parse_linter_rows(html_rows) do |constant_name, language, name, link|
|
|
@@ -54,7 +57,7 @@ module WayOfWorking
|
|
|
54
57
|
doc.css('article h2').each do |h2|
|
|
55
58
|
type = h2.text.strip
|
|
56
59
|
|
|
57
|
-
yield type, h2.next_element
|
|
60
|
+
yield type, h2.next_element&.css('tbody tr') || []
|
|
58
61
|
end
|
|
59
62
|
end
|
|
60
63
|
|
|
@@ -44,7 +44,7 @@ module WayOfWorking
|
|
|
44
44
|
say(Rainbow("\nTotal time taken: #{(Time.now - @start_time).to_i} seconds").yellow)
|
|
45
45
|
|
|
46
46
|
if !@rubocop_ok || !@megalinter_ok
|
|
47
|
-
abort(Rainbow("\nLinter failed!").red)
|
|
47
|
+
abort(Rainbow("\nLinter failed!").red) # rubocop:disable Rails/Exit -- Thor CLI, not a Rails app
|
|
48
48
|
else
|
|
49
49
|
say(Rainbow("\nLinter Succeeded!").green)
|
|
50
50
|
end
|
|
@@ -58,7 +58,7 @@ module WayOfWorking
|
|
|
58
58
|
File.dirname(path)
|
|
59
59
|
end
|
|
60
60
|
|
|
61
|
-
def run_rubocop(arguments)
|
|
61
|
+
def run_rubocop(arguments) # rubocop:disable Naming/PredicateMethod -- runs RuboCop, returns success
|
|
62
62
|
# We lazy-load RuboCop so that the task doesn't dramatically impact the
|
|
63
63
|
# load time of our commands.
|
|
64
64
|
require 'rubocop'
|
|
@@ -40,6 +40,18 @@ module WayOfWorking
|
|
|
40
40
|
|
|
41
41
|
CONFIG
|
|
42
42
|
|
|
43
|
+
# Only for repos with JavaScript: without a package-lock.json, `npm ci` would fail the run
|
|
44
|
+
MEGALINTER_ESLINT_CONFIG = <<~CONFIG
|
|
45
|
+
# Run the project's own eslint and eslint.config.js (the same as `npx eslint`).
|
|
46
|
+
# MegaLinter's bundled eslint can't resolve the config's plugins (neostandard etc.).
|
|
47
|
+
JAVASCRIPT_ES_PRE_COMMANDS:
|
|
48
|
+
- command: npm ci --ignore-scripts --no-audit --no-fund
|
|
49
|
+
cwd: workspace
|
|
50
|
+
continue_if_failed: false
|
|
51
|
+
JAVASCRIPT_ES_CLI_EXECUTABLE: node_modules/.bin/eslint
|
|
52
|
+
|
|
53
|
+
CONFIG
|
|
54
|
+
|
|
43
55
|
def give_code_standards_team_rw_access_to_repo
|
|
44
56
|
return unless github_organisation && github_full_repo_name
|
|
45
57
|
|
|
@@ -67,8 +79,9 @@ module WayOfWorking
|
|
|
67
79
|
copy_file '.github/linters/rubocop_defaults.yml'
|
|
68
80
|
end
|
|
69
81
|
|
|
70
|
-
def
|
|
71
|
-
|
|
82
|
+
def remove_github_linters_markdown_link_check_config_file
|
|
83
|
+
# MegaLinter no longer ships markdown-link-check
|
|
84
|
+
remove_file '.github/linters/.markdown-link-check.json'
|
|
72
85
|
end
|
|
73
86
|
|
|
74
87
|
def configure_markdownlint
|
|
@@ -80,20 +93,17 @@ module WayOfWorking
|
|
|
80
93
|
|
|
81
94
|
def configure_eslint
|
|
82
95
|
if javascript_files_present?
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
append_to_file '.eslintignore', "megalinter-reports/\n"
|
|
88
|
-
append_foldername_to_file_if_folder_exists '.eslintignore', 'node_modules'
|
|
89
|
-
append_foldername_to_file_if_folder_exists '.eslintignore', 'public'
|
|
90
|
-
append_foldername_to_file_if_folder_exists '.eslintignore', 'vendor'
|
|
91
|
-
protect_files_in_codeowners '.eslintignore'
|
|
96
|
+
# ESLint 9+ (as bundled with MegaLinter) only reads flat config
|
|
97
|
+
remove_file '.eslintrc.js'
|
|
98
|
+
remove_file '.eslintignore'
|
|
99
|
+
protect_and_copy_file 'eslint.config.js'
|
|
92
100
|
|
|
93
101
|
run 'npm install --save-dev ' \
|
|
94
|
-
'eslint
|
|
95
|
-
'eslint-plugin-cypress@^
|
|
96
|
-
'
|
|
102
|
+
'eslint@^10.14.0 ' \
|
|
103
|
+
'eslint-plugin-cypress@^7.0.4 ' \
|
|
104
|
+
'globals@^17.14.0 ' \
|
|
105
|
+
'neostandard@^0.14.1'
|
|
106
|
+
run 'npm pkg set scripts.lint="eslint ." scripts.lint:fix="eslint . --fix"'
|
|
97
107
|
else
|
|
98
108
|
say 'No JavaScript files found, skipping ESLint configuration'
|
|
99
109
|
end
|
|
@@ -105,6 +115,9 @@ module WayOfWorking
|
|
|
105
115
|
|
|
106
116
|
def copy_megalinter_dot_file
|
|
107
117
|
protect_and_copy_file '.mega-linter.yml'
|
|
118
|
+
return unless javascript_files_present?
|
|
119
|
+
|
|
120
|
+
inject_into_file '.mega-linter.yml', MEGALINTER_ESLINT_CONFIG, before: 'SHOW_ELAPSED_TIME:'
|
|
108
121
|
end
|
|
109
122
|
|
|
110
123
|
def create_gitignore_if_missing
|
|
@@ -151,12 +164,6 @@ module WayOfWorking
|
|
|
151
164
|
prepend_to_file file, content if File.exist?(file_path)
|
|
152
165
|
end
|
|
153
166
|
|
|
154
|
-
def append_foldername_to_file_if_folder_exists(file, foldername)
|
|
155
|
-
folder_path = File.join(destination_root, foldername)
|
|
156
|
-
|
|
157
|
-
append_to_file file, "#{foldername}\n" if File.directory?(folder_path)
|
|
158
|
-
end
|
|
159
|
-
|
|
160
167
|
def protect_and_copy_file(file)
|
|
161
168
|
protect_files_in_codeowners(file)
|
|
162
169
|
copy_file(file)
|
|
@@ -164,7 +171,7 @@ module WayOfWorking
|
|
|
164
171
|
|
|
165
172
|
def javascript_files_present?
|
|
166
173
|
Dir.glob(File.join(destination_root, '**/*.{js,jsx,mjs,cjs}')).
|
|
167
|
-
reject { |file| file.end_with?('.
|
|
174
|
+
reject { |file| file.end_with?('eslint.config.js') }.
|
|
168
175
|
reject { |file| file.include?('/megalinter-reports/') }.
|
|
169
176
|
any?
|
|
170
177
|
end
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
---
|
|
4
4
|
name: MegaLinter
|
|
5
5
|
|
|
6
|
-
on:
|
|
6
|
+
"on":
|
|
7
7
|
# Trigger mega-linter at key points in the PR process
|
|
8
8
|
pull_request:
|
|
9
9
|
types:
|
|
@@ -38,7 +38,7 @@ jobs:
|
|
|
38
38
|
steps:
|
|
39
39
|
# Git Checkout
|
|
40
40
|
- name: Checkout Code
|
|
41
|
-
uses: actions/checkout@
|
|
41
|
+
uses: actions/checkout@v6.0.2
|
|
42
42
|
with:
|
|
43
43
|
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
|
|
44
44
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
# Configuration file for MegaLinter
|
|
3
|
-
# See all available variables at https://megalinter.io/configuration/
|
|
3
|
+
# See all available variables at https://megalinter.io/latest/configuration/
|
|
4
4
|
# and in linters documentation
|
|
5
5
|
|
|
6
6
|
APPLY_FIXES: none # all, none, or list of linter keys
|
|
@@ -20,31 +20,23 @@ ENABLE_LINTERS: # All other linters will be disabled by default
|
|
|
20
20
|
- CPP_CLANG_FORMAT
|
|
21
21
|
- CPP_CPPCHECK
|
|
22
22
|
- CPP_CPPLINT
|
|
23
|
-
- CREDENTIALS_SECRETLINT
|
|
24
23
|
- CSS_SCSSLINT
|
|
25
24
|
- CSS_STYLELINT
|
|
26
|
-
- DOCKERFILE_DOCKERFILELINT
|
|
27
25
|
- DOCKERFILE_HADOLINT
|
|
28
26
|
- ENV_DOTENV_LINTER
|
|
29
27
|
- GHERKIN_GHERKIN_LINT
|
|
30
|
-
- GIT_GIT_DIFF
|
|
31
28
|
- GRAPHQL_GRAPHQL_SCHEMA_LINTER
|
|
32
29
|
- HTML_DJLINT
|
|
33
30
|
- HTML_HTMLHINT
|
|
34
31
|
- JAVASCRIPT_ES
|
|
35
|
-
- JSON_ESLINT_PLUGIN_JSONC
|
|
36
32
|
- JSON_JSONLINT
|
|
37
33
|
- JSON_NPM_PACKAGE_JSON_LINT
|
|
38
34
|
- JSON_PRETTIER
|
|
39
35
|
- JSON_V8R
|
|
40
36
|
- KOTLIN_DETEKT
|
|
41
37
|
- KOTLIN_KTLINT
|
|
42
|
-
- MAKEFILE_CHECKMAKE
|
|
43
|
-
- MARKDOWN_MARKDOWN_LINK_CHECK
|
|
44
38
|
- MARKDOWN_MARKDOWN_TABLE_FORMATTER
|
|
45
39
|
- MARKDOWN_MARKDOWNLINT
|
|
46
|
-
- MARKDOWN_REMARK_LINT
|
|
47
|
-
- OPENAPI_SPECTRAL
|
|
48
40
|
- PROTOBUF_PROTOLINT
|
|
49
41
|
- PYTHON_BANDIT
|
|
50
42
|
- PYTHON_BLACK
|
|
@@ -60,10 +52,7 @@ ENABLE_LINTERS: # All other linters will be disabled by default
|
|
|
60
52
|
- REPOSITORY_DEVSKIM
|
|
61
53
|
- REPOSITORY_DUSTILOCK
|
|
62
54
|
- REPOSITORY_GIT_DIFF
|
|
63
|
-
- REPOSITORY_GITLEAKS
|
|
64
|
-
- REPOSITORY_GOODCHECK
|
|
65
55
|
- REPOSITORY_GRYPE
|
|
66
|
-
- REPOSITORY_KICS
|
|
67
56
|
- REPOSITORY_LS_LINT
|
|
68
57
|
- REPOSITORY_SECRETLINT
|
|
69
58
|
- REPOSITORY_SEMGREP
|
|
@@ -72,18 +61,12 @@ ENABLE_LINTERS: # All other linters will be disabled by default
|
|
|
72
61
|
- REPOSITORY_TRIVY_SBOM
|
|
73
62
|
- REPOSITORY_TRUFFLEHOG
|
|
74
63
|
- SPELL_LYCHEE
|
|
75
|
-
- SPELL_MISSPELL
|
|
76
64
|
- SPELL_PROSELINT
|
|
77
65
|
- SPELL_VALE
|
|
78
|
-
- SQL_SQL_LINT
|
|
79
66
|
- SQL_SQLFLUFF
|
|
80
|
-
- SQL_TSQLLINT
|
|
81
67
|
- SWIFT_SWIFTLINT
|
|
82
|
-
- TERRAFORM_CHECKOV
|
|
83
|
-
- TERRAFORM_KICS
|
|
84
68
|
- TERRAFORM_TERRAFORM_FMT
|
|
85
69
|
- TERRAFORM_TERRAGRUNT
|
|
86
|
-
- TERRAFORM_TERRASCAN
|
|
87
70
|
- TERRAFORM_TFLINT
|
|
88
71
|
- XML_XMLLINT
|
|
89
72
|
- YAML_PRETTIER
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// ESLint flat config, used by `npx eslint` and by MegaLinter (see .mega-linter.yml)
|
|
2
|
+
const neostandard = require('neostandard')
|
|
3
|
+
const cypress = require('eslint-plugin-cypress')
|
|
4
|
+
const globals = require('globals')
|
|
5
|
+
|
|
6
|
+
module.exports = [
|
|
7
|
+
{
|
|
8
|
+
ignores: [
|
|
9
|
+
...neostandard.resolveIgnoresFromGitignore(),
|
|
10
|
+
'coverage/**',
|
|
11
|
+
'megalinter-reports/**',
|
|
12
|
+
'public/**',
|
|
13
|
+
'vendor/**'
|
|
14
|
+
]
|
|
15
|
+
},
|
|
16
|
+
...neostandard(),
|
|
17
|
+
{
|
|
18
|
+
languageOptions: { globals: { ...globals.browser, ...globals.node } }
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
files: ['**/*.cy.js', 'cypress/support/**/*.js'],
|
|
22
|
+
...cypress.configs.globals
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
files: ['**/*_spec.js'],
|
|
26
|
+
languageOptions: { globals: globals.jasmine }
|
|
27
|
+
}
|
|
28
|
+
]
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: way_of_working-code_linting-hdi
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tim Gentry
|
|
@@ -77,14 +77,13 @@ files:
|
|
|
77
77
|
- lib/way_of_working/code_linting/hdi/paths.rb
|
|
78
78
|
- lib/way_of_working/code_linting/hdi/plugin.rb
|
|
79
79
|
- lib/way_of_working/code_linting/hdi/supported_linter.rb
|
|
80
|
-
- lib/way_of_working/code_linting/hdi/templates/.eslintrc.js
|
|
81
|
-
- lib/way_of_working/code_linting/hdi/templates/.github/linters/.markdown-link-check.json
|
|
82
80
|
- lib/way_of_working/code_linting/hdi/templates/.github/linters/rubocop_defaults.yml
|
|
83
81
|
- lib/way_of_working/code_linting/hdi/templates/.github/workflows/mega-linter.yml
|
|
84
82
|
- lib/way_of_working/code_linting/hdi/templates/.mega-linter.yml
|
|
85
83
|
- lib/way_of_working/code_linting/hdi/templates/.rubocop
|
|
86
84
|
- lib/way_of_working/code_linting/hdi/templates/docs/way_of_working/code-linting/index.md.tt
|
|
87
85
|
- lib/way_of_working/code_linting/hdi/templates/docs/way_of_working/code-linting/linters.md.tt
|
|
86
|
+
- lib/way_of_working/code_linting/hdi/templates/eslint.config.js
|
|
88
87
|
- lib/way_of_working/code_linting/hdi/version.rb
|
|
89
88
|
homepage: https://github.com/HealthDataInsight/way_of_working-code_linting-hdi
|
|
90
89
|
licenses:
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
extends: ['standard'],
|
|
3
|
-
plugins: ['cypress', 'jasmine'],
|
|
4
|
-
overrides: [
|
|
5
|
-
{
|
|
6
|
-
// Cypress test files
|
|
7
|
-
files: ['**/*.cy.js'],
|
|
8
|
-
env: {
|
|
9
|
-
'cypress/globals': true
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
// Jasmine test files
|
|
14
|
-
files: ['**/*_spec.js'],
|
|
15
|
-
env: {
|
|
16
|
-
jasmine: true
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
]
|
|
20
|
-
}
|