This repository was archived by the owner on Jul 19, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit 86723c6
Be specific about what exceptions can be skipped
The Analyzer `#run` loop was rescuing *all* exceptions, which is
excessive. I don't think we should hard-fail on all exceptions, either:
the Ruby parser gem is definitely known to barf on some valid but
esoteric Ruby code, and I wouldn't be surprised if the other parsers had
similar edge cases.
So this changes behavior to only skip files for a known set of catchable
errors. The out-of-process parsers are a little tricky since all you can
get from them is an exit code and output streams: for now wrapping those
in our own exception class seems reasonable.
I'm still catching all exceptions, but only so that we can log a message
about which file is impacted before we re-raise. Since a raw exception
we'll likely abort on may not contain helpful information about the file
that triggered it, this would be helpful for debugging cases.1 parent 90b5a4e commit 86723c6
File tree
8 files changed
+101
-23
lines changed- lib/cc/engine/analyzers
- javascript
- php
- python
- spec/cc/engine/analyzers
- javascript
- php
- python
8 files changed
+101
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | + | ||
2 | + | ||
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
7 | + | ||
8 | + | ||
9 | + | ||
10 | + | ||
11 | + | ||
12 | + | ||
5 | 13 | | |
6 | 14 | | |
7 | 15 | | |
8 | 16 | | |
9 | 17 | | |
10 | 18 | | |
19 | + | ||
20 | + | ||
21 | + | ||
11 | 22 | | |
12 | - | ||
13 | - | ||
23 | + | ||
24 | + | ||
14 | 25 | | |
15 | 26 | | |
16 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | - | ||
1 | + | ||
2 | + | ||
3 | + | ||
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
| |||
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
58 | - | ||
59 | - | ||
60 | - | ||
60 | + | ||
61 | + | ||
62 | + | ||
63 | + | ||
64 | + | ||
65 | + | ||
66 | + | ||
67 | + | ||
61 | 68 | | |
62 | - | ||
63 | - | ||
69 | + | ||
70 | + | ||
64 | 71 | | |
65 | - | ||
72 | + | ||
73 | + | ||
74 | + | ||
75 | + | ||
76 | + | ||
66 | 77 | | |
67 | 78 | | |
68 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | + | ||
2 | + | ||
3 | + | ||
4 | + | ||
5 | + | ||
6 | + | ||
7 | + | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | - | ||
52 | - | ||
53 | - | ||
51 | + | ||
52 | + | ||
53 | + | ||
54 | 54 | | |
55 | - | ||
56 | - | ||
55 | + | ||
57 | 56 | | |
58 | - | ||
57 | + | ||
58 | + | ||
59 | + | ||
60 | + | ||
61 | + | ||
62 | + | ||
63 | + | ||
64 | + | ||
65 | + | ||
66 | + | ||
67 | + | ||
59 | 68 | | |
60 | 69 | | |
61 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | - | ||
2 | - | ||
1 | + | ||
2 | + | ||
3 | + | ||
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | - | ||
45 | - | ||
46 | - | ||
45 | + | ||
46 | + | ||
47 | + | ||
47 | 48 | | |
48 | - | ||
49 | - | ||
49 | + | ||
50 | 50 | | |
51 | - | ||
51 | + | ||
52 | + | ||
53 | + | ||
54 | + | ||
55 | + | ||
56 | + | ||
57 | + | ||
58 | + | ||
59 | + | ||
60 | + | ||
61 | + | ||
52 | 62 | | |
53 | 63 | | |
54 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | + | ||
40 | + | ||
41 | + | ||
42 | + | ||
43 | + | ||
44 | + | ||
45 | + | ||
46 | + | ||
47 | + | ||
48 | + | ||
39 | 49 | | |
40 | 50 | | |
41 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | + | ||
52 | + | ||
53 | + | ||
54 | + | ||
55 | + | ||
56 | + | ||
57 | + | ||
58 | + | ||
59 | + | ||
60 | + | ||
51 | 61 | | |
52 | 62 | | |
53 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | + | ||
40 | + | ||
41 | + | ||
42 | + | ||
43 | + | ||
44 | + | ||
45 | + | ||
46 | + | ||
47 | + | ||
48 | + | ||
39 | 49 | | |
40 | 50 | | |
41 | 51 | | |
| |||
0 commit comments