diff --git a/.cspell.json b/.cspell.json index 2a72c6814dd..4e2decfd693 100644 --- a/.cspell.json +++ b/.cspell.json @@ -1114,6 +1114,7 @@ "pylint", "pylint's", "pylintrc", + "pymdown", "pymdownx", "pypi", "pyproject", @@ -1404,6 +1405,7 @@ "vrefwarning", "vsiakka", "vuln", + "waitretry", "warnon", "wata", "webpreview", @@ -1446,4 +1448,4 @@ "\u0636clojure", "\u077bcbad" ] -} +} \ No newline at end of file diff --git a/.trivyignore b/.trivyignore index 301fa2b1e0e..96129cbcc69 100644 --- a/.trivyignore +++ b/.trivyignore @@ -162,6 +162,7 @@ CVE-2023-28840 CVE-2023-29017 CVE-2023-29199 CVE-2023-30547 +CVE-2023-32314 DS001 DS002 DS003 diff --git a/CHANGELOG.md b/CHANGELOG.md index 39c8c6d2db7..5c0ebbf60d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,7 @@ Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-l - mega-linter-runner v7 upgrader - Run stale workflow only on schedule, by @echoix in [#2641](https://github.com/oxsecurity/megalinter/pull/2641) - Add explicit permissions to stale workflow, by @echoix in [#2641](https://github.com/oxsecurity/megalinter/pull/2641) + - Allow MEGALINTER_CONFIG to contain a full path to a MegaLinter config file - Documentation - Apply many updates after the use of [Vale](https://vale.sh/) on MegaLinter own sources and docs diff --git a/Dockerfile b/Dockerfile index df2800817dc..33fe915edec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -368,7 +368,7 @@ RUN ALPINE_GLIBC_BASE_URL="https://github.com/sgerrand/alpine-pkg-glibc/releases Zvo9GI2e2MaZyo9/lvb+LbLEJZKEQckqRj4P26gmASrZEPStwc+yqy1ShHLA0j6m\ 1QIDAQAB\ -----END PUBLIC KEY-----" | sed 's/ */\n/g' > "/etc/apk/keys/sgerrand.rsa.pub" && \ - wget --quiet \ + wget --quiet --tries=10 --waitretry=10 \ "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \ "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \ "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && \ @@ -419,7 +419,7 @@ ENV PATH="${PATH}:/root/.dotnet/tools:/usr/share/dotnet" # Zvo9GI2e2MaZyo9/lvb+LbLEJZKEQckqRj4P26gmASrZEPStwc+yqy1ShHLA0j6m\ # 1QIDAQAB\ # -----END PUBLIC KEY-----" | sed 's/ */\n/g' > "/etc/apk/keys/sgerrand.rsa.pub" && \ -# wget --quiet \ +# wget --quiet --tries=10 --waitretry=10 \ # "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \ # "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \ # "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && \ diff --git a/README.md b/README.md index b88a7c4c8f6..cb0187d791f 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ MegaLinter is an **Open-Source** tool for **CI/CD workflows** that analyzes the Supporting [**55** languages](#languages), [**24** formats](#formats), [**21** tooling formats](#tooling-formats) and **ready to use out of the box**, as a GitHub action or any CI system **highly configurable** and **free for all uses**. -[**Upgrade to MegaLinter v7 !**]https://github.com/oxsecurity/megalinter/issues/2608 +[**Upgrade to MegaLinter v7 !**] diff --git a/docs/descriptors/xml_xmllint.md b/docs/descriptors/xml_xmllint.md index 2a0f09b98f8..3821a397df2 100644 --- a/docs/descriptors/xml_xmllint.md +++ b/docs/descriptors/xml_xmllint.md @@ -25,7 +25,7 @@ To apply file formatting you must set `XML_XMLLINT_CLI_LINT_MODE: file` and `XML | Variable | Description | Default value | |-----------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------| | XML_XMLLINT_AUTOFORMAT | If set to `true`, it will reformat and reindent the output | `false` | -| XML_XMLLINT_INDENT | The number of indentation spaces when `XML_XMLLINT_AUTOFORMAT` is `true` | ` ` | +| XML_XMLLINT_INDENT | The number of indentation spaces when `XML_XMLLINT_AUTOFORMAT` is `true` | `` | | XML_XMLLINT_ARGUMENTS | User custom arguments to add in linter CLI call
Ex: `-s --foo "bar"` | | | XML_XMLLINT_FILTER_REGEX_INCLUDE | Custom regex including filter
Ex: `(src\|lib)` | Include every file | | XML_XMLLINT_FILTER_REGEX_EXCLUDE | Custom regex excluding filter
Ex: `(test\|examples)` | Exclude no file | diff --git a/docs/index.md b/docs/index.md index b3cf949c6a4..eae6f508c61 100644 --- a/docs/index.md +++ b/docs/index.md @@ -30,7 +30,7 @@ MegaLinter is an **Open-Source** tool for **CI/CD workflows** that analyzes the Supporting [**55** languages](supported-linters.md#languages), [**24** formats](supported-linters.md#formats), [**21** tooling formats](supported-linters.md#tooling-formats) and **ready to use out of the box**, as a GitHub action or any CI system **highly configurable** and **free for all uses**. -[**Upgrade to MegaLinter v7 !**]https://github.com/oxsecurity/megalinter/issues/2608 +[**Upgrade to MegaLinter v7 !**] diff --git a/flavors/cupcake/Dockerfile b/flavors/cupcake/Dockerfile index db8c5333243..52adafa728b 100644 --- a/flavors/cupcake/Dockerfile +++ b/flavors/cupcake/Dockerfile @@ -309,7 +309,7 @@ RUN ALPINE_GLIBC_BASE_URL="https://github.com/sgerrand/alpine-pkg-glibc/releases Zvo9GI2e2MaZyo9/lvb+LbLEJZKEQckqRj4P26gmASrZEPStwc+yqy1ShHLA0j6m\ 1QIDAQAB\ -----END PUBLIC KEY-----" | sed 's/ */\n/g' > "/etc/apk/keys/sgerrand.rsa.pub" && \ - wget --quiet \ + wget --quiet --tries=10 --waitretry=10 \ "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \ "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \ "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && \ diff --git a/flavors/java/Dockerfile b/flavors/java/Dockerfile index 59b8ec1b8f9..2efeb9ab16d 100644 --- a/flavors/java/Dockerfile +++ b/flavors/java/Dockerfile @@ -243,7 +243,7 @@ RUN ALPINE_GLIBC_BASE_URL="https://github.com/sgerrand/alpine-pkg-glibc/releases Zvo9GI2e2MaZyo9/lvb+LbLEJZKEQckqRj4P26gmASrZEPStwc+yqy1ShHLA0j6m\ 1QIDAQAB\ -----END PUBLIC KEY-----" | sed 's/ */\n/g' > "/etc/apk/keys/sgerrand.rsa.pub" && \ - wget --quiet \ + wget --quiet --tries=10 --waitretry=10 \ "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \ "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \ "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && \ diff --git a/linters/clojure_clj_kondo/Dockerfile b/linters/clojure_clj_kondo/Dockerfile index 17012799f87..f7d1a8f729e 100644 --- a/linters/clojure_clj_kondo/Dockerfile +++ b/linters/clojure_clj_kondo/Dockerfile @@ -140,7 +140,7 @@ RUN ALPINE_GLIBC_BASE_URL="https://github.com/sgerrand/alpine-pkg-glibc/releases Zvo9GI2e2MaZyo9/lvb+LbLEJZKEQckqRj4P26gmASrZEPStwc+yqy1ShHLA0j6m\ 1QIDAQAB\ -----END PUBLIC KEY-----" | sed 's/ */\n/g' > "/etc/apk/keys/sgerrand.rsa.pub" && \ - wget --quiet \ + wget --quiet --tries=10 --waitretry=10 \ "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \ "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \ "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && \ diff --git a/linters/clojure_cljstyle/Dockerfile b/linters/clojure_cljstyle/Dockerfile index b6d3696a081..a0c249115f2 100644 --- a/linters/clojure_cljstyle/Dockerfile +++ b/linters/clojure_cljstyle/Dockerfile @@ -140,7 +140,7 @@ RUN ALPINE_GLIBC_BASE_URL="https://github.com/sgerrand/alpine-pkg-glibc/releases Zvo9GI2e2MaZyo9/lvb+LbLEJZKEQckqRj4P26gmASrZEPStwc+yqy1ShHLA0j6m\ 1QIDAQAB\ -----END PUBLIC KEY-----" | sed 's/ */\n/g' > "/etc/apk/keys/sgerrand.rsa.pub" && \ - wget --quiet \ + wget --quiet --tries=10 --waitretry=10 \ "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \ "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \ "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && \ diff --git a/linters/dart_dartanalyzer/Dockerfile b/linters/dart_dartanalyzer/Dockerfile index 03ee9b6fb4a..a8c3ca56e41 100644 --- a/linters/dart_dartanalyzer/Dockerfile +++ b/linters/dart_dartanalyzer/Dockerfile @@ -140,7 +140,7 @@ RUN ALPINE_GLIBC_BASE_URL="https://github.com/sgerrand/alpine-pkg-glibc/releases Zvo9GI2e2MaZyo9/lvb+LbLEJZKEQckqRj4P26gmASrZEPStwc+yqy1ShHLA0j6m\ 1QIDAQAB\ -----END PUBLIC KEY-----" | sed 's/ */\n/g' > "/etc/apk/keys/sgerrand.rsa.pub" && \ - wget --quiet \ + wget --quiet --tries=10 --waitretry=10 \ "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \ "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \ "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && \ diff --git a/megalinter/config.py b/megalinter/config.py index 117de16fb91..2dc99856fd9 100644 --- a/megalinter/config.py +++ b/megalinter/config.py @@ -52,6 +52,9 @@ def init_config(request_id, workspace=None, params={}): ), f"Unable to retrieve config file {config_file_name}" with open(config_file, "wb") as f: f.write(r.content) + # Hardcoded path to config file + elif os.path.isfile(config_file_name): + config_file = config_file_name else: # Local configuration file with name forced by user config_file = workspace + os.path.sep + config_file_name diff --git a/megalinter/constants.py b/megalinter/constants.py index d785f0ad0a7..2b85c3f57b9 100644 --- a/megalinter/constants.py +++ b/megalinter/constants.py @@ -19,9 +19,7 @@ DEFAULT_DOCKER_WORKSPACE_DIR = "/tmp/lint" DEFAULT_REPORT_FOLDER_NAME = "megalinter-reports" DEFAULT_SARIF_REPORT_FILE_NAME = "megalinter-report.sarif" -DEFAULT_SARIF_SCHEMA_URI = ( - "https://json.schemastore.org/sarif-2.1.0.json" -) +DEFAULT_SARIF_SCHEMA_URI = "https://json.schemastore.org/sarif-2.1.0.json" DEFAULT_SARIF_VERSION = "2.1.0" DEFAULT_RELEASE = "v7" diff --git a/megalinter/descriptors/clojure.megalinter-descriptor.yml b/megalinter/descriptors/clojure.megalinter-descriptor.yml index b678fcde7ec..fe7a1311551 100644 --- a/megalinter/descriptors/clojure.megalinter-descriptor.yml +++ b/megalinter/descriptors/clojure.megalinter-descriptor.yml @@ -28,7 +28,7 @@ install: Zvo9GI2e2MaZyo9/lvb+LbLEJZKEQckqRj4P26gmASrZEPStwc+yqy1ShHLA0j6m\ 1QIDAQAB\ -----END PUBLIC KEY-----" | sed 's/ */\\n/g' > "/etc/apk/keys/sgerrand.rsa.pub" && \ - wget --quiet \ + wget --quiet --tries=10 --waitretry=10 \ "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \ "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \ "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && \ diff --git a/megalinter/descriptors/dart.megalinter-descriptor.yml b/megalinter/descriptors/dart.megalinter-descriptor.yml index 51c869572c5..b67001482dd 100644 --- a/megalinter/descriptors/dart.megalinter-descriptor.yml +++ b/megalinter/descriptors/dart.megalinter-descriptor.yml @@ -22,7 +22,7 @@ install: Zvo9GI2e2MaZyo9/lvb+LbLEJZKEQckqRj4P26gmASrZEPStwc+yqy1ShHLA0j6m\ 1QIDAQAB\ -----END PUBLIC KEY-----" | sed 's/ */\\n/g' > "/etc/apk/keys/sgerrand.rsa.pub" && \ - wget --quiet \ + wget --quiet --tries=10 --waitretry=10 \ "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \ "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \ "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && \