feat: add nbqa linter for jupyter notebooks (#6240)
Some checks failed
Publish Images / Build and Test (push) Has been cancelled
Build and Test / Set build metadata (push) Has been cancelled
Build and Test / Build test suite matrix (push) Has been cancelled
Build and Test / preview-release-notes (push) Has been cancelled
Lint commit / commitlint (push) Has been cancelled
Publish Images / Release (push) Has been cancelled
Build and Test / Build and Test (push) Has been cancelled
Build and Test / Test the Super-linter GitHub Action (push) Has been cancelled
Build and Test / Run test cases (push) Has been cancelled
Build and Test / Check if all the tests passed (push) Has been cancelled

This commit is contained in:
Holt Skinner 2024-12-20 13:13:16 -06:00 committed by GitHub
parent 85f7611e0f
commit 469f30eb53
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
33 changed files with 478 additions and 4 deletions

View file

@ -147,6 +147,7 @@ updates:
- flake8 - flake8
- isort - isort
- mypy - mypy
- nbqa
- pyink - pyink
- pylint - pylint
- ruff - ruff

View file

@ -413,6 +413,7 @@ ENV PATH="${PATH}:/venvs/cpplint/bin"
ENV PATH="${PATH}:/venvs/flake8/bin" ENV PATH="${PATH}:/venvs/flake8/bin"
ENV PATH="${PATH}:/venvs/isort/bin" ENV PATH="${PATH}:/venvs/isort/bin"
ENV PATH="${PATH}:/venvs/mypy/bin" ENV PATH="${PATH}:/venvs/mypy/bin"
ENV PATH="${PATH}:/venvs/nbqa/bin"
ENV PATH="${PATH}:/venvs/pyink/bin" ENV PATH="${PATH}:/venvs/pyink/bin"
ENV PATH="${PATH}:/venvs/pylint/bin" ENV PATH="${PATH}:/venvs/pylint/bin"
ENV PATH="${PATH}:/venvs/ruff/bin" ENV PATH="${PATH}:/venvs/ruff/bin"

View file

@ -85,6 +85,7 @@ Super-linter supports the following tools:
| **JSON** | [eslint-plugin-jsonc (configured for JSON)](https://www.npmjs.com/package/eslint-plugin-jsonc) (default), [eslint-plugin-json](https://www.npmjs.com/package/eslint-plugin-json) | [Prettier](https://prettier.io/) | | **JSON** | [eslint-plugin-jsonc (configured for JSON)](https://www.npmjs.com/package/eslint-plugin-jsonc) (default), [eslint-plugin-json](https://www.npmjs.com/package/eslint-plugin-json) | [Prettier](https://prettier.io/) |
| **JSONC**, **JSON5** | [eslint-plugin-jsonc](https://www.npmjs.com/package/eslint-plugin-jsonc) | [Prettier](https://prettier.io/) | | **JSONC**, **JSON5** | [eslint-plugin-jsonc](https://www.npmjs.com/package/eslint-plugin-jsonc) | [Prettier](https://prettier.io/) |
| **JSX**, **TSX** | [eslint-plugin-jsx-a11y](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y), [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) | [Prettier](https://prettier.io/) | | **JSX**, **TSX** | [eslint-plugin-jsx-a11y](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y), [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) | [Prettier](https://prettier.io/) |
| **Jupyter Notebook** | [nbqa](https://nbqa.readthedocs.io/en/latest/index.html) | [nbqa](https://nbqa.readthedocs.io/en/latest/index.html) |
| **Kubernetes** | [kubeconform](https://github.com/yannh/kubeconform), [Checkov](https://www.checkov.io/) | See YAML formatters | | **Kubernetes** | [kubeconform](https://github.com/yannh/kubeconform), [Checkov](https://www.checkov.io/) | See YAML formatters |
| **Kotlin** | [ktlint](https://github.com/pinterest/ktlint) | | | **Kotlin** | [ktlint](https://github.com/pinterest/ktlint) | |
| **LaTeX** | [ChkTex](https://www.nongnu.org/chktex/) | | | **LaTeX** | [ChkTex](https://www.nongnu.org/chktex/) | |
@ -249,6 +250,9 @@ You can configure Super-linter using the following environment variables:
| **FIX_JSONC_PRETTIER** | `true` | Flag to enable or disable the formatting of JSONC and JSON5 files with Prettier. | | **FIX_JSONC_PRETTIER** | `true` | Flag to enable or disable the formatting of JSONC and JSON5 files with Prettier. |
| **FIX_JSX_PRETTIER** | `true` | Flag to enable or disable the formatting of JSX files with Prettier. | | **FIX_JSX_PRETTIER** | `true` | Flag to enable or disable the formatting of JSX files with Prettier. |
| **FIX_JSX** | `false` | Option to enable fix mode for `JSX`. | | **FIX_JSX** | `false` | Option to enable fix mode for `JSX`. |
| **FIX_JUPYTER_NBQA_BLACK** | `false` | Option to enable fix mode for `NBQA_BLACK`. |
| **FIX_JUPYTER_NBQA_ISORT** | `false` | Option to enable fix mode for `NBQA_ISORT`. |
| **FIX_JUPYTER_NBQA_RUFF** | `false` | Option to enable fix mode for `NBQA_RUFF`. |
| **FIX_MARKDOWN_PRETTIER** | `true` | Flag to enable or disable the formatting of Markdown files with Prettier. | | **FIX_MARKDOWN_PRETTIER** | `true` | Flag to enable or disable the formatting of Markdown files with Prettier. |
| **FIX_MARKDOWN** | `false` | Option to enable fix mode for `MARKDOWN`. | | **FIX_MARKDOWN** | `false` | Option to enable fix mode for `MARKDOWN`. |
| **FIX_POWERSHELL** | `false` | Option to enable fix mode for `POWERSHELL`. | | **FIX_POWERSHELL** | `false` | Option to enable fix mode for `POWERSHELL`. |
@ -285,6 +289,7 @@ You can configure Super-linter using the following environment variables:
| **JAVA_FILE_NAME** | `sun_checks.xml` | Filename for [Checkstyle configuration](https://checkstyle.sourceforge.io/config.html). Checkstyle embeds several configuration files, such as `sun_checks.xml`, `google_checks.xml` that you can use without providing your own configuration file. | | **JAVA_FILE_NAME** | `sun_checks.xml` | Filename for [Checkstyle configuration](https://checkstyle.sourceforge.io/config.html). Checkstyle embeds several configuration files, such as `sun_checks.xml`, `google_checks.xml` that you can use without providing your own configuration file. |
| **JAVASCRIPT_ES_CONFIG_FILE** | `.eslintrc.yml` | Filename for [ESLint configuration](https://eslint.org/docs/user-guide/configuring#configuration-file-formats) (ex: `.eslintrc.yml`, `.eslintrc.json`) | | **JAVASCRIPT_ES_CONFIG_FILE** | `.eslintrc.yml` | Filename for [ESLint configuration](https://eslint.org/docs/user-guide/configuring#configuration-file-formats) (ex: `.eslintrc.yml`, `.eslintrc.json`) |
| **JSCPD_CONFIG_FILE** | `.jscpd.json` | Filename for JSCPD configuration | | **JSCPD_CONFIG_FILE** | `.jscpd.json` | Filename for JSCPD configuration |
| **JUPYTER_NBQA_CONFIG_FILE** | `.jupyter-nbqa.toml` | Filename for [nbqa configuration](https://nbqa.readthedocs.io/en/latest/configuration.html) |
| **KUBERNETES_KUBECONFORM_OPTIONS** | `null` | Additional arguments to pass to the command-line when running **Kubernetes Kubeconform** (Example: --ignore-missing-schemas) | | **KUBERNETES_KUBECONFORM_OPTIONS** | `null` | Additional arguments to pass to the command-line when running **Kubernetes Kubeconform** (Example: --ignore-missing-schemas) |
| **LINTER_RULES_PATH** | `.github/linters` | Directory for all linter configuration rules. | | **LINTER_RULES_PATH** | `.github/linters` | Directory for all linter configuration rules. |
| **LOG_FILE** | `super-linter.log` | The filename for outputting logs. Super-linter saves the log file to `${DEFAULT_WORKSPACE}/${LOG_FILE}`. | | **LOG_FILE** | `super-linter.log` | The filename for outputting logs. Super-linter saves the log file to `${DEFAULT_WORKSPACE}/${LOG_FILE}`. |
@ -373,6 +378,12 @@ You can configure Super-linter using the following environment variables:
| **VALIDATE_JSONC_PRETTIER** | `true` | Flag to enable or disable checking the formatting of JSONC and JSON5 files with Prettier. | | **VALIDATE_JSONC_PRETTIER** | `true` | Flag to enable or disable checking the formatting of JSONC and JSON5 files with Prettier. |
| **VALIDATE_JSX** | `true` | Flag to enable or disable the linting process for jsx files (Utilizing: ESLint) | | **VALIDATE_JSX** | `true` | Flag to enable or disable the linting process for jsx files (Utilizing: ESLint) |
| **VALIDATE_JSX_PRETTIER** | `true` | Flag to enable or disable checking the formatting of JSX files with Prettier. | | **VALIDATE_JSX_PRETTIER** | `true` | Flag to enable or disable checking the formatting of JSX files with Prettier. |
| **VALIDATE_JUPYTER_NBQA_BLACK** | `true` | Flag to enable or disable the linting process of Jupyter Notebooks. (Utilizing: nbqa black) |
| **VALIDATE_JUPYTER_NBQA_FLAKE8** | `true` | Flag to enable or disable the linting process of Jupyter Notebooks. (Utilizing: nbqa flake8) |
| **VALIDATE_JUPYTER_NBQA_ISORT** | `true` | Flag to enable or disable the linting process of Jupyter Notebooks. (Utilizing: nbqa isort) |
| **VALIDATE_JUPYTER_NBQA_MYPY** | `true` | Flag to enable or disable the linting process of Jupyter Notebooks. (Utilizing: nbqa mypy) |
| **VALIDATE_JUPYTER_NBQA_PYLINT** | `true` | Flag to enable or disable the linting process of Jupyter Notebooks. (Utilizing: nbqa pylint) |
| **VALIDATE_JUPYTER_NBQA_RUFF** | `true` | Flag to enable or disable the linting process of Jupyter Notebooks. (Utilizing: nbqa ruff) |
| **VALIDATE_KOTLIN** | `true` | Flag to enable or disable the linting process of the Kotlin language. | | **VALIDATE_KOTLIN** | `true` | Flag to enable or disable the linting process of the Kotlin language. |
| **VALIDATE_KUBERNETES_KUBECONFORM** | `true` | Flag to enable or disable the linting process of Kubernetes descriptors with Kubeconform | | **VALIDATE_KUBERNETES_KUBECONFORM** | `true` | Flag to enable or disable the linting process of Kubernetes descriptors with Kubeconform |
| **VALIDATE_LATEX** | `true` | Flag to enable or disable the linting process of the LaTeX language. | | **VALIDATE_LATEX** | `true` | Flag to enable or disable the linting process of the LaTeX language. |

View file

1
dependencies/python/nbqa.txt vendored Normal file
View file

@ -0,0 +1 @@
nbqa==1.9.0

View file

@ -20,8 +20,8 @@ tool, do the following.
violations that the fix mode can automatically fix. Avoid test cases that violations that the fix mode can automatically fix. Avoid test cases that
fail only because of syntax errors, when possible. fail only because of syntax errors, when possible.
4. Update expected summary reports: `test/data/super-linter-summary`. 4. Update expected summary reports: `test/data/super-linter-summary`.
5. If the tool supports check-only mode or fix mode, add the `<LANGUGAGE>` to 5. If the tool supports check-only mode or fix mode, add the `<LANGUAGE>` to the
the `LANGUAGES_WITH_FIX_MODE` array in `test/testUtils.sh` `LANGUAGES_WITH_FIX_MODE` array in `test/testUtils.sh`
## Update the test suite ## Update the test suite

View file

@ -457,6 +457,13 @@ BuildFileArrays() {
elif [ "${FILE_TYPE}" == "jsx" ]; then elif [ "${FILE_TYPE}" == "jsx" ]; then
echo "${FILE}" >>"${FILE_ARRAYS_DIRECTORY_PATH}/file-array-JSX" echo "${FILE}" >>"${FILE_ARRAYS_DIRECTORY_PATH}/file-array-JSX"
echo "${FILE}" >>"${FILE_ARRAYS_DIRECTORY_PATH}/file-array-JSX_PRETTIER" echo "${FILE}" >>"${FILE_ARRAYS_DIRECTORY_PATH}/file-array-JSX_PRETTIER"
elif [ "${FILE_TYPE}" == "ipynb" ]; then
echo "${FILE}" >>"${FILE_ARRAYS_DIRECTORY_PATH}/file-array-JUPYTER_NBQA_BLACK"
echo "${FILE}" >>"${FILE_ARRAYS_DIRECTORY_PATH}/file-array-JUPYTER_NBQA_FLAKE8"
echo "${FILE}" >>"${FILE_ARRAYS_DIRECTORY_PATH}/file-array-JUPYTER_NBQA_ISORT"
echo "${FILE}" >>"${FILE_ARRAYS_DIRECTORY_PATH}/file-array-JUPYTER_NBQA_MYPY"
echo "${FILE}" >>"${FILE_ARRAYS_DIRECTORY_PATH}/file-array-JUPYTER_NBQA_PYLINT"
echo "${FILE}" >>"${FILE_ARRAYS_DIRECTORY_PATH}/file-array-JUPYTER_NBQA_RUFF"
elif [ "${FILE_TYPE}" == "kt" ] || [ "${FILE_TYPE}" == "kts" ]; then elif [ "${FILE_TYPE}" == "kt" ] || [ "${FILE_TYPE}" == "kts" ]; then
echo "${FILE}" >>"${FILE_ARRAYS_DIRECTORY_PATH}/file-array-KOTLIN" echo "${FILE}" >>"${FILE_ARRAYS_DIRECTORY_PATH}/file-array-KOTLIN"
elif [ "$FILE_TYPE" == "lua" ]; then elif [ "$FILE_TYPE" == "lua" ]; then

View file

@ -187,6 +187,12 @@ LINTER_COMMANDS_ARRAY_JSONC=(eslint -c "${JAVASCRIPT_ES_LINTER_RULES}" --ext '.j
LINTER_COMMANDS_ARRAY_JSONC_PRETTIER=("${PRETTIER_COMMAND[@]}") LINTER_COMMANDS_ARRAY_JSONC_PRETTIER=("${PRETTIER_COMMAND[@]}")
LINTER_COMMANDS_ARRAY_JSX=(eslint -c "${JSX_LINTER_RULES}") LINTER_COMMANDS_ARRAY_JSX=(eslint -c "${JSX_LINTER_RULES}")
LINTER_COMMANDS_ARRAY_JSX_PRETTIER=("${PRETTIER_COMMAND[@]}") LINTER_COMMANDS_ARRAY_JSX_PRETTIER=("${PRETTIER_COMMAND[@]}")
LINTER_COMMANDS_ARRAY_JUPYTER_NBQA_BLACK=(nbqa black --nbqa-shell)
LINTER_COMMANDS_ARRAY_JUPYTER_NBQA_FLAKE8=(nbqa flake8 --nbqa-shell)
LINTER_COMMANDS_ARRAY_JUPYTER_NBQA_ISORT=(nbqa isort --nbqa-shell)
LINTER_COMMANDS_ARRAY_JUPYTER_NBQA_MYPY=(nbqa mypy --nbqa-shell)
LINTER_COMMANDS_ARRAY_JUPYTER_NBQA_PYLINT=(nbqa pylint --nbqa-shell)
LINTER_COMMANDS_ARRAY_JUPYTER_NBQA_RUFF=(nbqa ruff --nbqa-shell)
LINTER_COMMANDS_ARRAY_KOTLIN=(ktlint "{/}") LINTER_COMMANDS_ARRAY_KOTLIN=(ktlint "{/}")
LINTER_COMMANDS_ARRAY_KUBERNETES_KUBECONFORM=(kubeconform -strict) LINTER_COMMANDS_ARRAY_KUBERNETES_KUBECONFORM=(kubeconform -strict)
if [ "${KUBERNETES_KUBECONFORM_OPTIONS}" != "null" ] && [ -n "${KUBERNETES_KUBECONFORM_OPTIONS}" ]; then if [ "${KUBERNETES_KUBECONFORM_OPTIONS}" != "null" ] && [ -n "${KUBERNETES_KUBECONFORM_OPTIONS}" ]; then

View file

@ -28,6 +28,12 @@ LANGUAGE_ARRAY=('ANSIBLE' 'ARM' 'BASH' 'BASH_EXEC' 'CHECKOV' 'CLANG_FORMAT'
"JSONC_PRETTIER" "JSONC_PRETTIER"
'JSX' 'JSX'
"JSX_PRETTIER" "JSX_PRETTIER"
"JUPYTER_NBQA_BLACK"
"JUPYTER_NBQA_FLAKE8"
"JUPYTER_NBQA_ISORT"
"JUPYTER_NBQA_MYPY"
"JUPYTER_NBQA_PYLINT"
"JUPYTER_NBQA_RUFF"
'KUBERNETES_KUBECONFORM' 'KOTLIN' 'LATEX' 'LUA' 'MARKDOWN' 'KUBERNETES_KUBECONFORM' 'KOTLIN' 'LATEX' 'LUA' 'MARKDOWN'
"MARKDOWN_PRETTIER" "MARKDOWN_PRETTIER"
'NATURAL_LANGUAGE' 'OPENAPI' 'PERL' 'PHP_BUILTIN' 'PHP_PHPCS' 'PHP_PHPSTAN' 'NATURAL_LANGUAGE' 'OPENAPI' 'PERL' 'PHP_BUILTIN' 'PHP_PHPCS' 'PHP_PHPSTAN'

View file

@ -24,6 +24,8 @@ JAVASCRIPT_PRETTIER_CHECK_ONLY_MODE_OPTIONS=("${PRETTIER_CHECK_ONLY_MODE_OPTIONS
JSON_PRETTIER_CHECK_ONLY_MODE_OPTIONS=("${PRETTIER_CHECK_ONLY_MODE_OPTIONS[@]}") JSON_PRETTIER_CHECK_ONLY_MODE_OPTIONS=("${PRETTIER_CHECK_ONLY_MODE_OPTIONS[@]}")
JSONC_PRETTIER_CHECK_ONLY_MODE_OPTIONS=("${PRETTIER_CHECK_ONLY_MODE_OPTIONS[@]}") JSONC_PRETTIER_CHECK_ONLY_MODE_OPTIONS=("${PRETTIER_CHECK_ONLY_MODE_OPTIONS[@]}")
JSX_PRETTIER_CHECK_ONLY_MODE_OPTIONS=("${PRETTIER_CHECK_ONLY_MODE_OPTIONS[@]}") JSX_PRETTIER_CHECK_ONLY_MODE_OPTIONS=("${PRETTIER_CHECK_ONLY_MODE_OPTIONS[@]}")
JUPYTER_NBQA_BLACK_CHECK_ONLY_MODE_OPTIONS=(--diff --check)
JUPYTER_NBQA_ISORT_CHECK_ONLY_MODE_OPTIONS=(--diff --check)
MARKDOWN_PRETTIER_CHECK_ONLY_MODE_OPTIONS=("${PRETTIER_CHECK_ONLY_MODE_OPTIONS[@]}") MARKDOWN_PRETTIER_CHECK_ONLY_MODE_OPTIONS=("${PRETTIER_CHECK_ONLY_MODE_OPTIONS[@]}")
PYTHON_BLACK_CHECK_ONLY_MODE_OPTIONS=(--diff --check) PYTHON_BLACK_CHECK_ONLY_MODE_OPTIONS=(--diff --check)
PYTHON_ISORT_CHECK_ONLY_MODE_OPTIONS=(--diff --check) PYTHON_ISORT_CHECK_ONLY_MODE_OPTIONS=(--diff --check)
@ -68,6 +70,7 @@ JSONC_FIX_MODE_OPTIONS=("${ESLINT_FIX_MODE_OPTIONS[@]}")
JSONC_PRETTIER_FIX_MODE_OPTIONS=("${PRETTIER_FIX_MODE_OPTIONS[@]}") JSONC_PRETTIER_FIX_MODE_OPTIONS=("${PRETTIER_FIX_MODE_OPTIONS[@]}")
JSX_FIX_MODE_OPTIONS=("${ESLINT_FIX_MODE_OPTIONS[@]}") JSX_FIX_MODE_OPTIONS=("${ESLINT_FIX_MODE_OPTIONS[@]}")
JSX_PRETTIER_FIX_MODE_OPTIONS=("${PRETTIER_FIX_MODE_OPTIONS[@]}") JSX_PRETTIER_FIX_MODE_OPTIONS=("${PRETTIER_FIX_MODE_OPTIONS[@]}")
JUPYTER_NBQA_RUFF_FIX_MODE_OPTIONS=(--fix)
MARKDOWN_FIX_MODE_OPTIONS=(--fix) MARKDOWN_FIX_MODE_OPTIONS=(--fix)
MARKDOWN_PRETTIER_FIX_MODE_OPTIONS=("${PRETTIER_FIX_MODE_OPTIONS[@]}") MARKDOWN_PRETTIER_FIX_MODE_OPTIONS=("${PRETTIER_FIX_MODE_OPTIONS[@]}")
NATURAL_LANGUAGE_FIX_MODE_OPTIONS=(--fix) NATURAL_LANGUAGE_FIX_MODE_OPTIONS=(--fix)

View file

@ -54,6 +54,8 @@ MARKDOWN_CUSTOM_RULE_GLOBS="${MARKDOWN_CUSTOM_RULE_GLOBS:-""}"
# shellcheck disable=SC2034 # Variable is referenced indirectly # shellcheck disable=SC2034 # Variable is referenced indirectly
MARKDOWN_FILE_NAME="${MARKDOWN_CONFIG_FILE:-.markdown-lint.yml}" MARKDOWN_FILE_NAME="${MARKDOWN_CONFIG_FILE:-.markdown-lint.yml}"
# shellcheck disable=SC2034 # Variable is referenced indirectly # shellcheck disable=SC2034 # Variable is referenced indirectly
JUPYTER_NBQA_FILE_NAME="${JUPYTER_NBQA_CONFIG_FILE:-.jupyter-nbqa.toml}"
# shellcheck disable=SC2034 # Variable is referenced indirectly
OPENAPI_FILE_NAME=".openapirc.yml" OPENAPI_FILE_NAME=".openapirc.yml"
# shellcheck disable=SC2034 # Variable is referenced indirectly # shellcheck disable=SC2034 # Variable is referenced indirectly
PERL_PERLCRITIC_OPTIONS="${PERL_PERLCRITIC_OPTIONS:-null}" PERL_PERLCRITIC_OPTIONS="${PERL_PERLCRITIC_OPTIONS:-null}"

View file

@ -632,7 +632,8 @@ cleanup() {
debug "Removing temporary files and directories" debug "Removing temporary files and directories"
rm -rf \ rm -rf \
"${GITHUB_WORKSPACE}/.mypy_cache" \ "${GITHUB_WORKSPACE}/.mypy_cache" \
"${GITHUB_WORKSPACE}/logback.log" "${GITHUB_WORKSPACE}/logback.log" \
"${GITHUB_WORKSPACE}/.ruff_cache"
if [[ "${SUPER_LINTER_COPIED_R_LINTER_RULES_FILE:-}" == "true" ]]; then if [[ "${SUPER_LINTER_COPIED_R_LINTER_RULES_FILE:-}" == "true" ]]; then
debug "Deleting ${R_RULES_FILE_PATH_IN_ROOT} because super-linter created it." debug "Deleting ${R_RULES_FILE_PATH_IN_ROOT} because super-linter created it."

View file

@ -47,6 +47,12 @@ LINTER_NAMES_ARRAY['JSONC']="eslint"
LINTER_NAMES_ARRAY['JSONC_PRETTIER']="prettier" LINTER_NAMES_ARRAY['JSONC_PRETTIER']="prettier"
LINTER_NAMES_ARRAY['JSX']="eslint" LINTER_NAMES_ARRAY['JSX']="eslint"
LINTER_NAMES_ARRAY['JSX_PRETTIER']="prettier" LINTER_NAMES_ARRAY['JSX_PRETTIER']="prettier"
LINTER_NAMES_ARRAY['JUPYTER_NBQA_BLACK']="nbqa"
LINTER_NAMES_ARRAY['JUPYTER_NBQA_FLAKE8']="nbqa"
LINTER_NAMES_ARRAY['JUPYTER_NBQA_ISORT']="nbqa"
LINTER_NAMES_ARRAY['JUPYTER_NBQA_MYPY']="nbqa"
LINTER_NAMES_ARRAY['JUPYTER_NBQA_PYLINT']="nbqa"
LINTER_NAMES_ARRAY['JUPYTER_NBQA_RUFF']="nbqa"
LINTER_NAMES_ARRAY['KOTLIN']="ktlint" LINTER_NAMES_ARRAY['KOTLIN']="ktlint"
LINTER_NAMES_ARRAY['KUBERNETES_KUBECONFORM']="kubeconform" LINTER_NAMES_ARRAY['KUBERNETES_KUBECONFORM']="kubeconform"
LINTER_NAMES_ARRAY['LATEX']="chktex" LINTER_NAMES_ARRAY['LATEX']="chktex"
@ -231,7 +237,7 @@ for LANGUAGE in "${!LINTER_NAMES_ARRAY[@]}"; do
elif [[ "${LINTER}" == "yamllint" ]]; then elif [[ "${LINTER}" == "yamllint" ]]; then
GET_VERSION_CMD="$("${LINTER}" --version | awk '{ print $2 }')" GET_VERSION_CMD="$("${LINTER}" --version | awk '{ print $2 }')"
# Some linters don't support a "get version" command # Some linters don't support a "get version" command
elif [[ ${LINTER} == "bash-exec" ]] || [[ ${LINTER} == "gherkin-lint" ]]; then elif [[ ${LINTER} == "bash-exec" ]] || [[ ${LINTER} == "nbqa" ]] || [[ ${LINTER} == "gherkin-lint" ]]; then
GET_VERSION_CMD="Version command not supported" GET_VERSION_CMD="Version command not supported"
else else
GET_VERSION_CMD="$("${LINTER}" --version 2>&1)" GET_VERSION_CMD="$("${LINTER}" --version 2>&1)"

View file

@ -43,6 +43,12 @@
| JSONC_PRETTIER | Fail ❌ | | JSONC_PRETTIER | Fail ❌ |
| JSX | Fail ❌ | | JSX | Fail ❌ |
| JSX_PRETTIER | Fail ❌ | | JSX_PRETTIER | Fail ❌ |
| JUPYTER_NBQA_BLACK | Fail ❌ |
| JUPYTER_NBQA_FLAKE8 | Fail ❌ |
| JUPYTER_NBQA_ISORT | Fail ❌ |
| JUPYTER_NBQA_MYPY | Fail ❌ |
| JUPYTER_NBQA_PYLINT | Fail ❌ |
| JUPYTER_NBQA_RUFF | Fail ❌ |
| KUBERNETES_KUBECONFORM | Fail ❌ | | KUBERNETES_KUBECONFORM | Fail ❌ |
| KOTLIN | Fail ❌ | | KOTLIN | Fail ❌ |
| LATEX | Fail ❌ | | LATEX | Fail ❌ |

View file

@ -48,6 +48,12 @@
| JSONC_PRETTIER | Fail ❌ | | JSONC_PRETTIER | Fail ❌ |
| JSX | Fail ❌ | | JSX | Fail ❌ |
| JSX_PRETTIER | Fail ❌ | | JSX_PRETTIER | Fail ❌ |
| JUPYTER_NBQA_BLACK | Fail ❌ |
| JUPYTER_NBQA_FLAKE8 | Fail ❌ |
| JUPYTER_NBQA_ISORT | Fail ❌ |
| JUPYTER_NBQA_MYPY | Fail ❌ |
| JUPYTER_NBQA_PYLINT | Fail ❌ |
| JUPYTER_NBQA_RUFF | Fail ❌ |
| KUBERNETES_KUBECONFORM | Fail ❌ | | KUBERNETES_KUBECONFORM | Fail ❌ |
| KOTLIN | Fail ❌ | | KOTLIN | Fail ❌ |
| LATEX | Fail ❌ | | LATEX | Fail ❌ |

View file

@ -43,6 +43,12 @@
| JSONC_PRETTIER | Pass ✅ | | JSONC_PRETTIER | Pass ✅ |
| JSX | Pass ✅ | | JSX | Pass ✅ |
| JSX_PRETTIER | Pass ✅ | | JSX_PRETTIER | Pass ✅ |
| JUPYTER_NBQA_BLACK | Pass ✅ |
| JUPYTER_NBQA_FLAKE8 | Pass ✅ |
| JUPYTER_NBQA_ISORT | Pass ✅ |
| JUPYTER_NBQA_MYPY | Pass ✅ |
| JUPYTER_NBQA_PYLINT | Pass ✅ |
| JUPYTER_NBQA_RUFF | Pass ✅ |
| KUBERNETES_KUBECONFORM | Pass ✅ | | KUBERNETES_KUBECONFORM | Pass ✅ |
| KOTLIN | Pass ✅ | | KOTLIN | Pass ✅ |
| LATEX | Pass ✅ | | LATEX | Pass ✅ |

View file

@ -48,6 +48,12 @@
| JSONC_PRETTIER | Pass ✅ | | JSONC_PRETTIER | Pass ✅ |
| JSX | Pass ✅ | | JSX | Pass ✅ |
| JSX_PRETTIER | Pass ✅ | | JSX_PRETTIER | Pass ✅ |
| JUPYTER_NBQA_BLACK | Pass ✅ |
| JUPYTER_NBQA_FLAKE8 | Pass ✅ |
| JUPYTER_NBQA_ISORT | Pass ✅ |
| JUPYTER_NBQA_MYPY | Pass ✅ |
| JUPYTER_NBQA_PYLINT | Pass ✅ |
| JUPYTER_NBQA_RUFF | Pass ✅ |
| KUBERNETES_KUBECONFORM | Pass ✅ | | KUBERNETES_KUBECONFORM | Pass ✅ |
| KOTLIN | Pass ✅ | | KOTLIN | Pass ✅ |
| LATEX | Pass ✅ | | LATEX | Pass ✅ |

View file

@ -24,6 +24,9 @@
| JSONC_PRETTIER | Pass ✅ | | JSONC_PRETTIER | Pass ✅ |
| JSX | Fail ❌ | | JSX | Fail ❌ |
| JSX_PRETTIER | Pass ✅ | | JSX_PRETTIER | Pass ✅ |
| JUPYTER_NBQA_BLACK | Pass ✅ |
| JUPYTER_NBQA_ISORT | Pass ✅ |
| JUPYTER_NBQA_RUFF | Pass ✅ |
| MARKDOWN | Pass ✅ | | MARKDOWN | Pass ✅ |
| MARKDOWN_PRETTIER | Pass ✅ | | MARKDOWN_PRETTIER | Pass ✅ |
| NATURAL_LANGUAGE | Pass ✅ | | NATURAL_LANGUAGE | Pass ✅ |

View file

@ -28,6 +28,9 @@
| JSONC_PRETTIER | Pass ✅ | | JSONC_PRETTIER | Pass ✅ |
| JSX | Fail ❌ | | JSX | Fail ❌ |
| JSX_PRETTIER | Pass ✅ | | JSX_PRETTIER | Pass ✅ |
| JUPYTER_NBQA_BLACK | Pass ✅ |
| JUPYTER_NBQA_ISORT | Pass ✅ |
| JUPYTER_NBQA_RUFF | Pass ✅ |
| MARKDOWN | Pass ✅ | | MARKDOWN | Pass ✅ |
| MARKDOWN_PRETTIER | Pass ✅ | | MARKDOWN_PRETTIER | Pass ✅ |
| NATURAL_LANGUAGE | Pass ✅ | | NATURAL_LANGUAGE | Pass ✅ |

View file

@ -185,6 +185,7 @@ control "super-linter-installed-commands" do
{ linter_name: "lua", version_option: "-v"}, { linter_name: "lua", version_option: "-v"},
{ linter_name: "markdownlint"}, { linter_name: "markdownlint"},
{ linter_name: "mypy"}, { linter_name: "mypy"},
{ linter_name: "nbqa"},
{ linter_name: "npm-groovy-lint"}, { linter_name: "npm-groovy-lint"},
{ linter_name: "perl"}, { linter_name: "perl"},
{ linter_name: "php"}, { linter_name: "php"},
@ -415,6 +416,7 @@ control "super-linter-installed-pypi-packages" do
"flake8", "flake8",
"isort", "isort",
"mypy", "mypy",
"nbqa",
"pyink", "pyink",
"pylint", "pylint",
"ruff", "ruff",
@ -517,6 +519,7 @@ control "super-linter-validate-files" do
"/action/lib/.automation/.luacheckrc", "/action/lib/.automation/.luacheckrc",
"/action/lib/.automation/.markdown-lint.yml", "/action/lib/.automation/.markdown-lint.yml",
"/action/lib/.automation/.mypy.ini", "/action/lib/.automation/.mypy.ini",
"/action/lib/.automation/.jupyter-nbqa.toml",
"/action/lib/.automation/.openapirc.yml", "/action/lib/.automation/.openapirc.yml",
"/action/lib/.automation/.perlcriticrc", "/action/lib/.automation/.perlcriticrc",
"/action/lib/.automation/.powershell-psscriptanalyzer.psd1", "/action/lib/.automation/.powershell-psscriptanalyzer.psd1",

View file

@ -0,0 +1,32 @@
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": []
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
}
},
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "hHETjoFLGZmM"
},
"outputs": [],
"source": [
"a=1;b=2\n",
"c=a+b\n",
"BROKEN_VAR=BROKEN_VAR\n",
"print(c)"
]
}
]
}

View file

@ -0,0 +1,32 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "hHETjoFLGZmM"
},
"outputs": [],
"source": [
"a = 1\n",
"b = 2\n",
"c = a + b\n",
"print(c)"
]
}
],
"metadata": {
"colab": {
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
"name": "python3"
},
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

View file

@ -0,0 +1,32 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "hHETjoFLGZmM"
},
"outputs": [],
"source": [
"a=1;b=2\n",
"c=a+b\n",
"BROKEN_VAR=BROKEN_VAR\n",
"print(c)"
]
}
],
"metadata": {
"colab": {
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
"name": "python3"
},
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

View file

@ -0,0 +1,32 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "hHETjoFLGZmM"
},
"outputs": [],
"source": [
"a = 1\n",
"b = 2\n",
"c = a + b\n",
"print(c)"
]
}
],
"metadata": {
"colab": {
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
"name": "python3"
},
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

View file

@ -0,0 +1,38 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "hHETjoFLGZmM"
},
"outputs": [],
"source": [
"import json\n",
"from os import getenv, path\n",
"from pprint import pprint\n",
"import sys\n",
"\n",
"\n",
"a=1;b=2\n",
"c=a+b\n",
"BROKEN_VAR=BROKEN_VAR\n",
"print(c)"
]
}
],
"metadata": {
"colab": {
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
"name": "python3"
},
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

View file

@ -0,0 +1,32 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "hHETjoFLGZmM"
},
"outputs": [],
"source": [
"a = 1\n",
"b = 2\n",
"c = a + b\n",
"print(c)"
]
}
],
"metadata": {
"colab": {
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
"name": "python3"
},
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

View file

@ -0,0 +1,32 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "hHETjoFLGZmM"
},
"outputs": [],
"source": [
"a=1;b=2\n",
"c=a+b\n",
"BROKEN_VAR=BROKEN_VAR\n",
"print(c)"
]
}
],
"metadata": {
"colab": {
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
"name": "python3"
},
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

View file

@ -0,0 +1,32 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "hHETjoFLGZmM"
},
"outputs": [],
"source": [
"a = 1\n",
"b = 2\n",
"c = a + b\n",
"print(c)"
]
}
],
"metadata": {
"colab": {
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
"name": "python3"
},
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

View file

@ -0,0 +1,32 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "hHETjoFLGZmM"
},
"outputs": [],
"source": [
"a=1;b=2\n",
"c=a+b\n",
"BROKEN_VAR=BROKEN_VAR\n",
"print(c)"
]
}
],
"metadata": {
"colab": {
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
"name": "python3"
},
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

View file

@ -0,0 +1,34 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "hHETjoFLGZmM"
},
"outputs": [],
"source": [
"\"\"\"Test Python file for Pylint.\"\"\"\n",
"\n",
"A = 1\n",
"B = 2\n",
"C = A + B\n",
"print(C)"
]
}
],
"metadata": {
"colab": {
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
"name": "python3"
},
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

View file

@ -0,0 +1,33 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "hHETjoFLGZmM"
},
"outputs": [],
"source": [
"import pandas\n",
"import numpy as np\n",
"\n",
"c = 1 + 2\n",
"print(c)"
]
}
],
"metadata": {
"colab": {
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
"name": "python3"
},
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

View file

@ -0,0 +1,32 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "hHETjoFLGZmM"
},
"outputs": [],
"source": [
"a = 1\n",
"b = 2\n",
"c = a + b\n",
"print(c)"
]
}
],
"metadata": {
"colab": {
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
"name": "python3"
},
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

View file

@ -53,6 +53,9 @@ LANGUAGES_WITH_FIX_MODE=(
"JSONC_PRETTIER" "JSONC_PRETTIER"
"JSX" "JSX"
"JSX_PRETTIER" "JSX_PRETTIER"
"JUPYTER_NBQA_BLACK"
"JUPYTER_NBQA_ISORT"
"JUPYTER_NBQA_RUFF"
"MARKDOWN" "MARKDOWN"
"MARKDOWN_PRETTIER" "MARKDOWN_PRETTIER"
"NATURAL_LANGUAGE" "NATURAL_LANGUAGE"