Skip to content

Commit

Permalink
[automation] Auto-update linters version, help and documentation (#1195)
Browse files Browse the repository at this point in the history
* [automation] Auto-update linters version, help and documentation

* [MegaLinter] Apply linters fixes

* QuickFix Gitlab  comments reporter

quick build push

Co-authored-by: nvuillam <[email protected]>
  • Loading branch information
nvuillam and nvuillam authored Jan 24, 2022
1 parent 418d1cf commit 65bac7c
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 49 deletions.
64 changes: 32 additions & 32 deletions .automation/generated/flavors-stats.json
Original file line number Diff line number Diff line change
Expand Up @@ -505,8 +505,8 @@
2425607
],
[
"2022-01-24T00:21:24",
2425743
"2022-01-24T01:38:36",
2425831
]
],
"ci_light": [
Expand Down Expand Up @@ -1015,8 +1015,8 @@
6637
],
[
"2022-01-24T00:21:24",
6640
"2022-01-24T01:38:36",
6643
]
],
"dart": [
Expand Down Expand Up @@ -1525,8 +1525,8 @@
1962
],
[
"2022-01-24T00:21:24",
1963
"2022-01-24T01:38:36",
1964
]
],
"documentation": [
Expand Down Expand Up @@ -2035,8 +2035,8 @@
31874
],
[
"2022-01-24T00:21:24",
31880
"2022-01-24T01:38:36",
31889
]
],
"dotnet": [
Expand Down Expand Up @@ -2545,8 +2545,8 @@
270760
],
[
"2022-01-24T00:21:24",
270804
"2022-01-24T01:38:36",
270840
]
],
"go": [
Expand Down Expand Up @@ -3055,8 +3055,8 @@
7246
],
[
"2022-01-24T00:21:24",
7254
"2022-01-24T01:38:36",
7255
]
],
"java": [
Expand Down Expand Up @@ -3565,8 +3565,8 @@
52669
],
[
"2022-01-24T00:21:24",
52682
"2022-01-24T01:38:36",
52690
]
],
"javascript": [
Expand Down Expand Up @@ -4075,8 +4075,8 @@
77114
],
[
"2022-01-24T00:21:24",
77175
"2022-01-24T01:38:36",
77254
]
],
"php": [
Expand Down Expand Up @@ -4585,8 +4585,8 @@
3753
],
[
"2022-01-24T00:21:24",
3754
"2022-01-24T01:38:36",
3755
]
],
"python": [
Expand Down Expand Up @@ -5095,8 +5095,8 @@
48456
],
[
"2022-01-24T00:21:24",
48531
"2022-01-24T01:38:36",
48564
]
],
"ruby": [
Expand Down Expand Up @@ -5601,8 +5601,8 @@
1769
],
[
"2022-01-24T00:21:24",
1770
"2022-01-24T01:38:36",
1771
]
],
"rust": [
Expand Down Expand Up @@ -6107,8 +6107,8 @@
1501
],
[
"2022-01-24T00:21:24",
1502
"2022-01-24T01:38:36",
1503
]
],
"salesforce": [
Expand Down Expand Up @@ -6617,8 +6617,8 @@
9925
],
[
"2022-01-24T00:21:24",
9929
"2022-01-24T01:38:36",
9930
]
],
"scala": [
Expand Down Expand Up @@ -7123,8 +7123,8 @@
1348
],
[
"2022-01-24T00:21:24",
1349
"2022-01-24T01:38:36",
1350
]
],
"swift": [
Expand Down Expand Up @@ -7629,8 +7629,8 @@
1387
],
[
"2022-01-24T00:21:24",
1388
"2022-01-24T01:38:36",
1389
]
],
"terraform": [
Expand Down Expand Up @@ -8139,8 +8139,8 @@
33452
],
[
"2022-01-24T00:21:24",
33453
"2022-01-24T01:38:36",
33496
]
]
}
2 changes: 1 addition & 1 deletion .automation/generated/linter-helps.json
Original file line number Diff line number Diff line change
Expand Up @@ -1381,7 +1381,7 @@
" of opening bracket's line.",
" --ignore errors Comma-separated list of errors and warnings to ignore",
" (or skip). For example, ``--ignore=E4,E51,W234``.",
" (Default: ['E704', 'E226', 'W503', 'W504', 'E126',",
" (Default: ['W503', 'W504', 'E704', 'E126', 'E226',",
" 'E121', 'E24', 'E123'])",
" --extend-ignore errors",
" Comma-separated list of errors and warnings to add to",
Expand Down
2 changes: 1 addition & 1 deletion .automation/generated/linter-versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"bash-exec": "5.1.0",
"black": "21.12",
"cfn-lint": "0.57.0",
"checkov": "2.0.745",
"checkov": "2.0.746",
"checkstyle": "9.2.1",
"chktex": "1.7.6",
"clippy": "0.1.58",
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Note: Can be used with `megalinter/megalinter@beta` in your GitHub Action mega-l
- [htmlhint](https://htmlhint.com/) from 1.1.0 to **1.1.1** on 2022-01-23
- [tsqllint](https://github.com/tsqllint/tsqllint) from 1.14.0.0 to **1.14.3.0** on 2022-01-23
- [checkov](https://www.checkov.io/) from 2.0.744 to **2.0.745** on 2022-01-23
- [checkov](https://www.checkov.io/) from 2.0.745 to **2.0.746** on 2022-01-24
<!-- linter-versions-end -->

## [v5.6.0] - 2022-01-22
Expand Down
4 changes: 2 additions & 2 deletions docs/all_linters.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
| [**bash-exec**](https://tiswww.case.edu/php/chet/bash/bashtop.html){target=_blank} | 5.1.0 | <!-- --> | [BASH](descriptors/bash_bash_exec.md) | <!-- --> | [Web Site](https://tiswww.case.edu/php/chet/bash/bashtop.html){target=_blank} |
| [**black**](https://github.com/psf/black){target=_blank} | 21.12 | [MIT](licenses/black.md) | [PYTHON](descriptors/python_black.md) | :white_circle: | [Repository](https://github.com/psf/black){target=_blank} |
| [**cfn-lint**](https://github.com/martysweet/cfn-lint){target=_blank} | 0.57.0 | <!-- --> | [CLOUDFORMATION](descriptors/cloudformation_cfn_lint.md) | :white_circle: | [Web Site](https://github.com/martysweet/cfn-lint){target=_blank} |
| [**checkov**](https://github.com/bridgecrewio/checkov){target=_blank} | 2.0.745 | [Apache-2.0](licenses/checkov.md) | [TERRAFORM](descriptors/terraform_checkov.md) | :no_entry_sign: | [Repository](https://github.com/bridgecrewio/checkov){target=_blank} |
| [**checkov**](https://github.com/bridgecrewio/checkov){target=_blank} | 2.0.746 | [Apache-2.0](licenses/checkov.md) | [TERRAFORM](descriptors/terraform_checkov.md) | :no_entry_sign: | [Repository](https://github.com/bridgecrewio/checkov){target=_blank} |
| [**checkstyle**](https://github.com/checkstyle/checkstyle){target=_blank} | 9.2.1 | [Other](licenses/checkstyle.md) | [JAVA](descriptors/java_checkstyle.md) | :heart: | [MegaLinter reference](https://checkstyle.sourceforge.io/index.html#Related_Tools_Active_Tools){target=_blank} |
| [**chktex**](https://www.nongnu.org/chktex){target=_blank} | 1.7.6 | <!-- --> | [LATEX](descriptors/latex_chktex.md) | :white_circle: | [Web Site](https://www.nongnu.org/chktex){target=_blank} |
| [**clippy**](https://github.com/rust-lang/rust-clippy){target=_blank} | 0.1.58 | <!-- --> | [RUST](descriptors/rust_clippy.md) | :white_circle: | [Web Site](https://github.com/rust-lang/rust-clippy){target=_blank} |
Expand All @@ -27,7 +27,7 @@
| [**editorconfig-checker**](https://github.com/editorconfig-checker/editorconfig-checker){target=_blank} | 2.3.5 | [MIT](licenses/editorconfig-checker.md) | [EDITORCONFIG](descriptors/editorconfig_editorconfig_checker.md) | :heart: | [MegaLinter reference](https://github.com/editorconfig-checker/editorconfig-checker#mega-linter){target=_blank} |
| [**eslint**](https://github.com/eslint/eslint){target=_blank} | 8.7.0 | [MIT](licenses/eslint.md) | [JAVASCRIPT](descriptors/javascript_eslint.md)<br/> [JSX](descriptors/jsx_eslint.md)<br/> [TSX](descriptors/tsx_eslint.md)<br/> [TYPESCRIPT](descriptors/typescript_eslint.md) | :heart: | [MegaLinter reference](https://eslint.org/docs/user-guide/integrations#source-control){target=_blank} |
| [**eslint-plugin-jsonc**](https://github.com/ota-meshi/eslint-plugin-jsonc){target=_blank} | 2.0.0 | [MIT](licenses/eslint-plugin-jsonc.md) | [JSON](descriptors/json_eslint_plugin_jsonc.md) | :heart: | [MegaLinter reference](https://eslint.org/docs/user-guide/integrations#source-control){target=_blank} |
| [**flake8**](https://github.com/PyCQA/flake8){target=_blank} | 4.0.1 | [MIT](licenses/flake8.md) | [PYTHON](descriptors/python_flake8.md) | :white_circle: | [Repository](https://github.com/PyCQA/flake8){target=_blank} |
| [**flake8**](https://github.com/PyCQA/flake8){target=_blank} | 4.0.1 | [Other](licenses/flake8.md) | [PYTHON](descriptors/python_flake8.md) | :white_circle: | [Repository](https://github.com/PyCQA/flake8){target=_blank} |
| [**gherkin-lint**](https://github.com/vsiakka/gherkin-lint){target=_blank} | N/A | <!-- --> | [GHERKIN](descriptors/gherkin_gherkin_lint.md) | :white_circle: | [Web Site](https://github.com/vsiakka/gherkin-lint){target=_blank} |
| [**git_diff**](https://github.com/git/git){target=_blank} | 2.30.2 | [Other](licenses/git_diff.md) | [GIT](descriptors/git_git_diff.md) | <!-- --> | [Repository](https://github.com/git/git){target=_blank} |
| [**golangci-lint**](https://github.com/golangci/golangci-lint){target=_blank} | 1.43.0 | [GPL-3.0](licenses/golangci-lint.md) | [GO](descriptors/go_golangci_lint.md) | :white_circle: | [Repository](https://github.com/golangci/golangci-lint){target=_blank} |
Expand Down
2 changes: 1 addition & 1 deletion docs/descriptors/python_flake8.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ optional arguments:
of opening bracket's line.
--ignore errors Comma-separated list of errors and warnings to ignore
(or skip). For example, ``--ignore=E4,E51,W234``.
(Default: ['E704', 'E226', 'W503', 'W504', 'E126',
(Default: ['W503', 'W504', 'E704', 'E126', 'E226',
'E121', 'E24', 'E123'])
--extend-ignore errors
Comma-separated list of errors and warnings to add to
Expand Down
2 changes: 1 addition & 1 deletion docs/descriptors/terraform_checkov.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

## checkov documentation

- Version in MegaLinter: **2.0.745**
- Version in MegaLinter: **2.0.746**
- Visit [Official Web Site](https://www.checkov.io/){target=_blank}
- See [How to disable checkov rules in files](https://www.checkov.io/2.Basics/Suppressing%20and%20Skipping%20Policies.html){target=_blank}
- See [Index of problems detected by checkov](https://www.checkov.io/5.Policy%20Index/all.html){target=_blank}
Expand Down
3 changes: 2 additions & 1 deletion megalinter/reporters/GithubCommentReporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
Post a GitHub status for each linter
"""
import logging
from megalinter.utils_reporter import build_markdown_summary
import os
import re

import github
from megalinter import Reporter, config
from megalinter.constants import ML_DOC_URL, ML_REPO_URL
from megalinter.utils_reporter import build_markdown_summary

mega_linter_version = config.get("BUILD_VERSION", "latest")
DOCS_URL_DESCRIPTORS_ROOT = f"{ML_DOC_URL}/{mega_linter_version}/descriptors"
Expand Down
4 changes: 2 additions & 2 deletions megalinter/reporters/GitlabCommentReporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
Post a GitHub status for each linter
"""
import logging
from megalinter.utils_reporter import build_markdown_summary

import gitlab
from megalinter import Reporter, config
from megalinter.utils_reporter import build_markdown_summary


class GitlabCommentReporter(Reporter):
Expand Down Expand Up @@ -87,7 +87,7 @@ def produce_report(self):
# Check if there is already a MegaLinter comment
for comment in existing_comments:
if (
"See errors details in [**artifact Mega-Linter reports** on"
"See errors details in [**artifact MegaLinter reports** on"
in comment.body
):
existing_comment = comment
Expand Down
17 changes: 9 additions & 8 deletions megalinter/utils_reporter.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import logging
import os
import urllib
from pytablewriter import MarkdownTableWriter

from megalinter import config
from megalinter.constants import (
ML_DOC_URL,
ML_DOC_URL_DESCRIPTORS_ROOT,
ML_REPO,
ML_REPO_ISSUES_URL,
)
from pytablewriter import MarkdownTableWriter

mega_linter_version = config.get("BUILD_VERSION", "latest")
DOCS_URL_DESCRIPTORS_ROOT = f"{ML_DOC_URL}/{mega_linter_version}/descriptors"
Expand Down Expand Up @@ -79,18 +80,18 @@ def build_markdown_summary(reporter_self, action_run_url):
+ log_link(f"**{reporter_self.master.status.upper()}**", action_run_url)
)
p_r_msg = (
f"## [Mega-Linter]({ML_DOC_URL}) status: {status_with_href}"
f"## [MegaLinter]({ML_DOC_URL}) status: {status_with_href}"
+ os.linesep
+ os.linesep
)
p_r_msg += table_content + os.linesep
if action_run_url != "":
p_r_msg += (
"See errors details in [**artifact Mega-Linter reports** on "
"See errors details in [**artifact MegaLinter reports** on "
f"CI Job page]({action_run_url})" + os.linesep
)
else:
p_r_msg += "See errors details in Mega-Linter reports" + os.linesep
p_r_msg += "See errors details in MegaLinter reports" + os.linesep
if reporter_self.master.validate_all_code_base is False:
p_r_msg += (
"_Set `VALIDATE_ALL_CODEBASE: true` in mega-linter.yml to validate "
Expand All @@ -102,24 +103,24 @@ def build_markdown_summary(reporter_self, action_run_url):
p_r_msg += (
os.linesep
+ "You could have same capabilities but better runtime performances"
" if you request a new Mega-Linter flavor.\n"
" if you request a new MegaLinter flavor.\n"
)
body = (
"Mega-Linter would run faster on my project if I had a flavor containing the following "
"MegaLinter would run faster on my project if I had a flavor containing the following "
"list of linters: \n\n - Add languages/linters list here\n\n"
"Would it be possible to create one ? Thanks :relaxed:"
)
new_flavor_url = (
f"{ML_REPO_ISSUES_URL}/new?assignees=&labels=enhancement&template=feature_request.md"
f"&title={urllib.parse.quote('Request new Mega-Linter flavor')}"
f"&title={urllib.parse.quote('Request new MegaLinter flavor')}"
f"&body={urllib.parse.quote(body)}"
)
p_r_msg += f"- [**Click here to request the new flavor**]({new_flavor_url})"
else:
p_r_msg += (
os.linesep
+ "You could have the same capabilities but better runtime performances"
" if you use a Mega-Linter flavor:" + os.linesep
" if you use a MegaLinter flavor:" + os.linesep
)
for suggestion in reporter_self.master.flavor_suggestions:
build_version = os.environ.get("BUILD_VERSION", "v5")
Expand Down

0 comments on commit 65bac7c

Please sign in to comment.