From 48a715b5f5af301abc7cf83208c226de5ae94f34 Mon Sep 17 00:00:00 2001 From: Donghak PARK Date: Fri, 2 Feb 2024 16:11:23 +0900 Subject: [PATCH] [CI] Add pylintrc for ignore tensorflow import error Currently, there is an import error related to TensorFlow when performing a Pylint inspection. This is a problem where import related to TensorFlow~Keras generates errors before execution because TensorFlow works on Keras-related code during runtime. To correct this problem, create a pylintrc file and perform exception tasks. **Changes proposed in this PR:** - modified: ../../.github/workflows/pylint.yml - new file: ../../tools/pylintrc Resolves: #2450 **Self evaluation:** 1. Build test: [X]Passed [ ]Failed [ ]Skipped 2. Run test: [X]Passed [ ]Failed [ ]Skipped Signed-off-by: Donghak PARK --- .github/workflows/pylint.yml | 4 ++-- ci/pylintrc | 36 ++++++++++++++++++++++++++++++++++ {tools => ci}/requirements.txt | 0 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 ci/pylintrc rename {tools => ci}/requirements.txt (100%) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 98822c86..5846a109 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -45,7 +45,7 @@ jobs: run: | python -m pip install --upgrade pip pip install pylint==3.0.2 numpy wheel - pip install -r tools/requirements.txt + pip install -r ci/requirements.txt - name: Run PyLint on changed files run: | - echo "${{ steps.get_file_changes.outputs.files}}" | tr " " "\n" | grep ".py$" | xargs pylint + echo "${{ steps.get_file_changes.outputs.files}}" | tr " " "\n" | grep ".py$" | xargs pylint --rcfile=ci/pylintrc diff --git a/ci/pylintrc b/ci/pylintrc new file mode 100644 index 00000000..aa382004 --- /dev/null +++ b/ci/pylintrc @@ -0,0 +1,36 @@ +[MASTER] + +[MESSAGESCONTROL] +disable= + too-many-instance-attributes, + len-as-condition, + too-few-public-methods, + anomalous-backslash-in-string, + no-else-return, + simplifiable-if-statement, + too-many-arguments, + duplicate-code, + no-name-in-module, + no-member, + raw-checker-failed, + bad-inline-option, + locally-disabled, + file-ignored, + suppressed-message, + useless-suppression, + deprecated-pragma, + import-error, + missing-docstring, + invalid-name, + consider-using-enumerate + +[SIMILARITIES] + +# Ignore comments when computing similarities. +ignore-comments=yes + +# Ignore docstrings when computing similarities. +ignore-docstrings=yes + +# Ignore imports when computing similarities. +ignore-imports=no diff --git a/tools/requirements.txt b/ci/requirements.txt similarity index 100% rename from tools/requirements.txt rename to ci/requirements.txt -- 2.34.1