Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: enable the reporting of parsing related problems when running deno lint #24332

Merged
merged 12 commits into from
Jul 23, 2024

Conversation

HasanAlrimawi
Copy link
Contributor

Supported reporting of syntax/parsing errors.

The commit is made to address issue #23437

Code changes

Added check for ParsedSource.diagnostics() and when it's not empty, all parse diagnostic errors will be logged/displayed.

PS: The change was within fn handle_lint_result() to log any found parse or lint diagnostic errors, since this function is called after any lint is done.

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, could you add a test to tests/specs/lint/ that exercises this change?

cli/tools/lint/mod.rs Outdated Show resolved Hide resolved
@HasanAlrimawi
Copy link
Contributor Author

Hello @bartlomieju ,
I added a test to exercise the change, but the PR check (ci / lint debug linux-x86_64) failed because the test I added includes syntax error (unterminated string constant) in the script file. However, this syntax error was intentionally added to show that the change done can detect this syntax error.
Is there a way to overcome this from my or your side, or should I just remove the test?
PR check failed

@HasanAlrimawi
Copy link
Contributor Author

Hello @bartlomieju ,
Just as a notification.
What do you think is best to do with the case here

@bartlomieju
Copy link
Member

@HasanAlrimawi you need to update .dprint.json file and add the file you added to the "excludes" config so that it's not being formatted.

.dprint.json Outdated Show resolved Hide resolved
Signed-off-by: David Sherret <dsherret@users.noreply.github.com>
cli/tools/lint/mod.rs Outdated Show resolved Hide resolved
Signed-off-by: David Sherret <dsherret@users.noreply.github.com>
Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@dsherret dsherret enabled auto-merge (squash) July 23, 2024 20:36
@dsherret dsherret merged commit f0df54f into denoland:main Jul 23, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants