From eec862d0ea33fe6a836dfd545eef1125e530c794 Mon Sep 17 00:00:00 2001 From: Shop-kins Date: Wed, 31 Jul 2024 08:27:11 +0100 Subject: [PATCH] fix: update pylint to ignore import-errors (#5927) -re-instates previous super-linter pylint functionality -ignoring import errors is desired as super-linter does not support installing dependencies as it runs -creates a new test case file for confirming import-errors are disabled this consists of a 3rd party import and a basic usage --- TEMPLATES/.python-lint | 7 +++++++ test/linters/python_pylint/python_good_2.py | 5 +++++ 2 files changed, 12 insertions(+) create mode 100644 test/linters/python_pylint/python_good_2.py diff --git a/TEMPLATES/.python-lint b/TEMPLATES/.python-lint index 0f974f1c..a61a6656 100644 --- a/TEMPLATES/.python-lint +++ b/TEMPLATES/.python-lint @@ -2,3 +2,10 @@ # Use multiple processes to speed up Pylint. jobs=0 + +[MESSAGES CONTROL] + +# Ignoring Import Errors is desired as super-linter +# does not support installing dependencies as it runs +disable=import-error + diff --git a/test/linters/python_pylint/python_good_2.py b/test/linters/python_pylint/python_good_2.py new file mode 100644 index 00000000..b9207b8d --- /dev/null +++ b/test/linters/python_pylint/python_good_2.py @@ -0,0 +1,5 @@ +"""Test Python file for Pylint.""" + +import pytest + +print(pytest)