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

Gracefully handle LexicalError's from semgrep-core #1999

Merged
merged 1 commit into from
Nov 10, 2020

Conversation

mschwager
Copy link
Contributor

E.g.

$ python3 -m semgrep --pattern '$X == $X' --lang c /tmp/test.c --verbose
Warning: Semgrep encountered a lexical error when running - on /tmp/test.c. Please ensure this is valid code.
ran 1 rules on 1 files: 0 findings
1 files could not be analyzed; run with --verbose for details or run with --strict to exit non-zero if any file cannot be analyzed
$ python3 -m semgrep --pattern '$X == $X' --lang c /tmp/test.c --json
{"results": [], "errors": [{"type": "LexicalError", "code": 11, "path": "/tmp/test.c", "rule_id": "-"}]}
ran 1 rules on 1 files: 0 findings
1 files could not be analyzed; run with --verbose for details or run with --strict to exit non-zero if any file cannot be analyzed

@github-actions
Copy link
Contributor

You added quite a few lines in semgrep, but didn't update the changelog. Consider doing so!

@nbrahms
Copy link
Contributor

nbrahms commented Nov 10, 2020

NICE!!!!!!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants