Skip to content

Commit

Permalink
Enhance ESLint Disable Check and Code Coverage Disable Check with Det…
Browse files Browse the repository at this point in the history
…ailed Messages (#3007)

* feat: add script to check for code coverage disable statements

* Add code coverage disable check to GitHub workflows

* Formatted code_coverage_disable_check.py to comply with all coding and documentation standards.

* add functionality in eslint_disable_check.py to run for mutliple directories

* removed unnecessary comment

* excluded node_modules from eslint disable check

* removed all eslint disable statements and code coverage disable statements

* Revert "excluded node_modules from eslint disable check"

This reverts commit b575036.

* Revert "removed all eslint disable statements and code coverage disable statements"

This reverts commit 62d4232.

* excluded node_modules from eslint disable check

* code-coverage check runs for only changed files

* add tj-actions

* add tj actions in check code coverage job

* Fix GitHub Actions workflow to identify and pass nearest changed directories to Python script

* syntax correction

* minor fix

* minor fix

* minor fix

* added repo root

* fix error

* fix error

* added support for checking .ts files for eslint-disable statements

* added support for checking .ts files for code coverage disable statements

* minor change

* Remove test files and ensured that python files follow coding standards

* fixes bug

* fix error

* removed eslint disable command from check for linting errors in modified files step

* Update code coverage and ESLint disable check workflows to include additional messages

---------

Co-authored-by: im-vedant <[email protected]>
Co-authored-by: Peter Harrison <[email protected]>
  • Loading branch information
3 people authored Dec 28, 2024
1 parent a99b146 commit 81c66d9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/code_coverage_disable_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ def check_code_coverage(files_or_dirs):
file_path = os.path.join(root, file_name)
if has_code_coverage_disable(file_path):
print(
f"""File {file_path} contains code coverage
disable statement."""
f"""File {file_path} contains code coverage disable statement."""
)
code_coverage_found = True
elif os.path.isfile(item):
Expand All @@ -104,8 +103,7 @@ def check_code_coverage(files_or_dirs):
):
if has_code_coverage_disable(item):
print(
f"""File {item} contains code coverage disable
statement."""
f"""File {item} contains code coverage disable statement. Please remove it and add the appropriate tests."""
)
code_coverage_found = True

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/eslint_disable_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def check_eslint(files_or_directories):
# If it's a file, directly check it
if item.endswith(".ts") or item.endswith(".tsx"):
if has_eslint_disable(item):
print(f"File {item} contains eslint-disable statement.")
print(f"File {item} contains eslint-disable statement. Please remove them and ensure the code adheres to the specified ESLint rules.")
eslint_found = True
elif os.path.isdir(item):
# If it's a directory, walk through it and check all
Expand Down

0 comments on commit 81c66d9

Please sign in to comment.