-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: better handle errors in static analysis
This was needed already. But ultimately inspired by a user tha had the following error: ``` File "codecov_cli/services/staticanalysis/analyzers/python/node_wrappers.py", line 41, in do_visit first_if_statement = first_if_statement.children[0] IndexError: list index out of range ``` Despite my best efforts, I was only able to reproduce this error using invalid Python code (i.e. an empty `if` statement) Regardless of what caused this issue in the 1st place, there may be valid reasons for someone to have malformed code in their repo (depending what the repo is 👀) So we should be able to still upload _something_ and ignore the failures. The tricky thing here is that without the static analysis data ATS can't work well. And we can't be sure that the analyzer doesn't have bugs. I don't think this case in particular is one of them, but I could be wrong. So these changes actually are a way to surface processing errors AND ignore the files that generated them, WHILE also surfacing errors to users. They are surfaced twice. Ideally users would look at them and let us know if something is not right. But maybe we should still fail the static analysis step in their CI? 🧐
- Loading branch information
1 parent
01986b6
commit 22b4630
Showing
5 changed files
with
150 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters