Skip to content

Commit

Permalink
Implemented suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
adithyanotfound committed Jan 14, 2025
1 parent 314d235 commit df5db71
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/scripts/eslint_disable_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)

Expand Down Expand Up @@ -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."
)

Expand Down
2 changes: 2 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit df5db71

Please sign in to comment.