Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add makefile linter within python flavor #1771

Merged
merged 3 commits into from
Aug 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-l
- Fix version in URL in logs produced by reporters
- Improve documentation for TAP_REPORTER
- Fix flavors suggestions to ignore linters not relevant for such flavor ([#1746](https://github.com/oxsecurity/megalinter/issues/1746))
- Add Makefile linter within python flavor

- Linter versions upgrades
- [eslint-plugin-jsonc](https://ota-meshi.github.io/eslint-plugin-jsonc/) from 2.3.1 to **2.4.0** on 2022-08-16
Expand Down
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fi

# Manage newest git versions (related to CVE https://github.blog/2022-04-12-git-security-vulnerability-announced/)
#
if [[ "${WORKSPACE_AS_SAFE_DIR}" != 'false' && "${DEFAULT_WORKSPACE}" && -d "${DEFAULT_WORKSPACE}" ]] ; then
if [[ "${WORKSPACE_AS_SAFE_DIR}" != 'false' && "${DEFAULT_WORKSPACE}" && -d "${DEFAULT_WORKSPACE}" ]]; then
echo "Setting git safe.directory DEFAULT_WORKSPACE: ${DEFAULT_WORKSPACE} ..."
git config --global --add safe.directory "${DEFAULT_WORKSPACE}"
else
Expand Down
6 changes: 6 additions & 0 deletions flavors/python/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,12 @@ RUN ML_THIRD_PARTY_DIR="/third-party/kubeconform" \
&& find ${ML_THIRD_PARTY_DIR} -type f -not -name 'LICENSE*' -delete -o -type d -empty -delete


# checkmake installation
RUN ( [ -d /usr/local/bin ] || mkdir -p /usr/local/bin ) \
&& wget -q "https://github.com/mrtazz/checkmake/releases/download/0.2.1/checkmake-0.2.1.linux.amd64" -O /usr/local/bin/checkmake \
&& chmod 755 /usr/local/bin/checkmake


# protolint installation
COPY --from=protolint /usr/local/bin/protolint /usr/bin/

Expand Down
1 change: 1 addition & 0 deletions flavors/python/flavor.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"KOTLIN_KTLINT",
"KUBERNETES_KUBEVAL",
"KUBERNETES_KUBECONFORM",
"MAKEFILE_CHECKMAKE",
"MARKDOWN_MARKDOWNLINT",
"MARKDOWN_MARKDOWN_LINK_CHECK",
"MARKDOWN_MARKDOWN_TABLE_FORMATTER",
Expand Down
1 change: 1 addition & 0 deletions megalinter/descriptors/all_flavors.json
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@
"KOTLIN_KTLINT",
"KUBERNETES_KUBEVAL",
"KUBERNETES_KUBECONFORM",
"MAKEFILE_CHECKMAKE",
"MARKDOWN_MARKDOWNLINT",
"MARKDOWN_MARKDOWN_LINK_CHECK",
"MARKDOWN_MARKDOWN_TABLE_FORMATTER",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ descriptor_flavors:
- all # Applicable to CI in any language project
- ci_light
- dotnet
- python
file_names_regex:
- "Makefile"
test_folder: makefile
Expand Down