From 5308dd0e51f912cc962cc71bedf20c35217740d5 Mon Sep 17 00:00:00 2001 From: AbcSxyZ Date: Sat, 18 Dec 2021 14:51:15 +0100 Subject: [PATCH 1/2] configure pylint for tests --- .github/workflows/lint-py.yml | 10 ++++++++-- pylintrc.tests | 7 +++++++ 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 pylintrc.tests diff --git a/.github/workflows/lint-py.yml b/.github/workflows/lint-py.yml index 2cfbebd..7c6f76f 100644 --- a/.github/workflows/lint-py.yml +++ b/.github/workflows/lint-py.yml @@ -24,5 +24,11 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - name: Run linter - run: find . -name "*.py" | xargs pylint + - name: Run linter for images code + run: find . -name "*.py" ! -path "*/tests/*" | xargs pylint + + - name: Install pylint dependencies for tests + run: pip3 install pytest + + - name: Run linter for tests code + run: find "./tests" -name "*.py" | xargs pylint --rcfile=pylintrc.tests diff --git a/pylintrc.tests b/pylintrc.tests new file mode 100644 index 0000000..d8358ad --- /dev/null +++ b/pylintrc.tests @@ -0,0 +1,7 @@ +[entrypoint-tests] +disable = duplicate-code, # Tests having similar code + no-member, # pytest global variables in conftest.py not detected + consider-using-with, # conftest temporary directory would need a with + import-error # EntrypointHook unable to import entrypoint + + From b3a0aef40004ce18457436a1c132b7920d22a929 Mon Sep 17 00:00:00 2001 From: AbcSxyZ Date: Sat, 18 Dec 2021 20:02:19 +0100 Subject: [PATCH 2/2] rename pylintrc configuration section --- pylintrc.tests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pylintrc.tests b/pylintrc.tests index d8358ad..aa7425f 100644 --- a/pylintrc.tests +++ b/pylintrc.tests @@ -1,4 +1,4 @@ -[entrypoint-tests] +[tests-configuration] disable = duplicate-code, # Tests having similar code no-member, # pytest global variables in conftest.py not detected consider-using-with, # conftest temporary directory would need a with