diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 80c13f5168..afbbf66b5b 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -195,16 +195,15 @@ jobs: id: changed-files uses: tj-actions/changed-files@v45 - - name: Filter TypeScript files - id: filter-files - run: | - echo "ts_files=$(echo '${{ steps.changed-files.outputs.all_changed_files }}' | tr ',' '\n' | grep -E '\.(ts|tsx)$' | tr '\n' ' ')" >> $GITHUB_OUTPUT - shell: bash + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.9 - name: Run Python script - if: steps.filter-files.outputs.ts_files != '' run: | - python .github/workflows/scripts/eslint_disable_check.py --files ${{ steps.filter-files.outputs.ts_files }} + python .github/workflows/scripts/eslint_disable_check.py --files ${{ steps.changed-files.outputs.all_changed_files }} + Check-Code-Coverage-Disable: name: Check for code coverage disable diff --git a/.github/workflows/scripts/eslint_disable_check.py b/.github/workflows/scripts/eslint_disable_check.py index ae93350f02..84d608aaa5 100644 --- a/.github/workflows/scripts/eslint_disable_check.py +++ b/.github/workflows/scripts/eslint_disable_check.py @@ -38,9 +38,7 @@ def has_eslint_disable(file_path): """ # Initialize key variables eslint_disable_pattern = re.compile( - r"\/\/\s*eslint-disable(?:-next-line|-line)?[^\n]*|" - r"\/\*\s*eslint-disable[^\*]*\*\/|" - r"\/\*[\s\S]*?eslint-disable[\s\S]*?\*\/", + r"\/\/.*eslint-disable.*|\/\*[\s\S]*?eslint-disable[\s\S]*?\*\/", re.IGNORECASE | re.DOTALL, ) @@ -86,7 +84,7 @@ def check_eslint(files_or_directories): file_path = os.path.join(root, file_name) if has_eslint_disable(file_path): print( - f"Error: File {item} contains " + f"Error: File {file_path} contains " "eslint-disable statements." ) diff --git a/src/App.tsx b/src/App.tsx index a12f3e7ceb..24214640f6 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -99,6 +99,8 @@ function app(): JSX.Element { const { data, loading } = useQuery(CHECK_AUTH); + /* eslint-disable-next-line */ + useEffect(() => { if (!loading && data?.checkAuth) { const auth = data.checkAuth;