Skip to content

Commit

Permalink
Don't show error count for extended reason renderer
Browse files Browse the repository at this point in the history
Summary: Extended reasons intended as a detailed document rather than a CLI summary so we don't want to include the error count in the generated message

Reviewed By: vassilmladenov

Differential Revision: D66098611

fbshipit-source-id: 3a378b6cd2b734915daa8dd60c9d913b23127b86
  • Loading branch information
Michael Thomas authored and facebook-github-bot committed Nov 19, 2024
1 parent 944e795 commit 4cf06f1
Show file tree
Hide file tree
Showing 55 changed files with 2 additions and 56 deletions.
4 changes: 2 additions & 2 deletions hphp/hack/src/errors/errors.ml
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,7 @@ let format_summary
~(max_errors : int option) : string option =
match format with
| Context
| Highlighted
| Extended ->
| Highlighted ->
let error_count_message =
if Int.( = ) error_count 0 then
"No errors!"
Expand Down Expand Up @@ -544,6 +543,7 @@ let format_summary
^ found_s
^ truncated_message
^ "\n")
| Extended
| Raw
| Plain ->
None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,4 +453,3 @@ File arraykey_sub_newtype_if_unsat.php, line 3, character 19 - line 3, character
4 |
5 | function foo(MyThing $_): void {}

3 errors found
1 change: 0 additions & 1 deletion hphp/hack/test/extended_reasons/assign_list.php.exp
Original file line number Diff line number Diff line change
Expand Up @@ -201,4 +201,3 @@ File assign_list.php, line 4, character 7 - line 4, character 9:
8 | function bar_1((string,Super,bool) $xyz): void {
9 | list($_, $y, $_) = $xyz;

1 error found
1 change: 0 additions & 1 deletion hphp/hack/test/extended_reasons/assign_local.php.exp
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,3 @@ File assign_local.php, line 4, character 7 - line 4, character 9:
9 | function bar(Super $f): void {
10 | $g = $f;

1 error found
1 change: 0 additions & 1 deletion hphp/hack/test/extended_reasons/assign_obj_get.php.exp
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,3 @@ File assign_obj_get.php, line 4, character 7 - line 4, character 9:
9 | }
10 | }

1 error found
1 change: 0 additions & 1 deletion hphp/hack/test/extended_reasons/assign_vector_bad.php.exp
Original file line number Diff line number Diff line change
Expand Up @@ -214,4 +214,3 @@ File assign_vector_bad.php, line 3, character 22 - line 3, character 27:
5 | return $v;
6 | }

2 errors found
1 change: 0 additions & 1 deletion hphp/hack/test/extended_reasons/bad_inout_lvalue9.php.exp
Original file line number Diff line number Diff line change
Expand Up @@ -315,4 +315,3 @@ File bad_inout_lvalue9.php, line 6, character 11 - line 6, character 23:
6 | f(inout »tuple($x, $y)«);
7 | }

4 errors found
1 change: 0 additions & 1 deletion hphp/hack/test/extended_reasons/class_constant.php.exp
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,3 @@ File class_constant.php, line 7, character 17 - line 7, character 19:
9 | return $x;
10 | }

1 error found
Original file line number Diff line number Diff line change
Expand Up @@ -272,4 +272,3 @@ File class_subtyping_contravariant.php, line 5, character 37 - line 5, character

as the instantiation of the generic T1

1 error found
Original file line number Diff line number Diff line change
Expand Up @@ -257,4 +257,3 @@ File class_subtyping_covariant.php, line 9, character 7 - line 9, character 9:
10 |
11 | function takes_my_a(MyA<Sub, Super, Super> $_): void {}

1 error found
Original file line number Diff line number Diff line change
Expand Up @@ -271,4 +271,3 @@ File class_subtyping_invariant.php, line 5, character 41 - line 5, character 42:

as the instantiation of the generic T2

1 error found
1 change: 0 additions & 1 deletion hphp/hack/test/extended_reasons/complex/metachain.php.exp
Original file line number Diff line number Diff line change
Expand Up @@ -729,4 +729,3 @@ File metachain.php, line 21, character 23 - line 23, character 3:
25 |
26 | <<__NoAutoLikes>>

6 errors found
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,3 @@ File workplace_abstract_class_as_typeconst.php, line 13, character 57 - line 13,
15 | }
16 | }

1 error found
Original file line number Diff line number Diff line change
Expand Up @@ -357,4 +357,3 @@ File workplace_contravariant.php, line 12, character 63 - line 12, character 66:
14 | }
15 | }

1 error found
Original file line number Diff line number Diff line change
Expand Up @@ -599,4 +599,3 @@ File workplace_invariant.php, line 15, character 47 - line 15, character 48:
16 | return foo::class;
17 | }

3 errors found
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,3 @@ File workplace_non_abstract_tyconst.php, line 23, character 23 - line 27, charac
29 |
30 | final class UseCase {

2 errors found
Original file line number Diff line number Diff line change
Expand Up @@ -185,4 +185,3 @@ File workplace_non_exact.php, line 4, character 21 - line 4, character 24:
5 | }
6 | }

2 errors found
Original file line number Diff line number Diff line change
Expand Up @@ -3700,4 +3700,3 @@ File workplace_shape_mismatch.php, line 12, character 13 - line 12, character 18
15 | ?'_PIRANHA_SANDBOX_QUEUED_' => bool,

The supertype didn't exist because the field was missing.
17 errors found
1 change: 0 additions & 1 deletion hphp/hack/test/extended_reasons/ctor_generic.php.exp
Original file line number Diff line number Diff line change
Expand Up @@ -360,4 +360,3 @@ File ctor_generic.php, line 20, character 63 - line 20, character 66:
22 | }
23 | }

1 error found
1 change: 0 additions & 1 deletion hphp/hack/test/extended_reasons/fn_call.php.exp
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,3 @@ File fn_call.php, line 3, character 14 - line 3, character 19:
6 | foo($y);
7 | }

1 error found
1 change: 0 additions & 1 deletion hphp/hack/test/extended_reasons/fn_call_variadic.php.exp
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,3 @@ File fn_call_variadic.php, line 3, character 26 - line 3, character 27:
6 | foo($x, $y, $z);
7 | }

1 error found
1 change: 0 additions & 1 deletion hphp/hack/test/extended_reasons/fn_ret.php.exp
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,3 @@ File fn_ret.php, line 7, character 17 - line 7, character 20:
8 | return foo();
9 | }

1 error found
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,3 @@ File fn_subtyping_contra_1.php, line 4, character 7 - line 4, character 9:
6 | function foo_1((function(Super): void) $_): void {}
7 | function bar_1((function(Sub): void) $f): void {

1 error found
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,3 @@ File fn_subtyping_contra_2.php, line 4, character 7 - line 4, character 9:
6 | function foo_2((function((function(Sub): void)): void) $_): void {}
7 | function bar_2((function((function(Super): void)): void) $f): void {

1 error found
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,3 @@ File fn_subtyping_variadic_1.php, line 4, character 7 - line 4, character 9:
6 | function foo_variadic_1((function(Sub, Super):void) $_): void {}
7 | function bar_variadic_1((function(Sub...):void) $x): void {

1 error found
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,3 @@ File fn_subtyping_variadic_2.php, line 4, character 7 - line 4, character 9:
6 | function foo_variadic_2((function(Sub, Super...):void) $_): void {}
7 | function bar_variadic_2((function(Sub...):void) $x): void {

1 error found
Original file line number Diff line number Diff line change
Expand Up @@ -324,4 +324,3 @@ File generic_subtyping_caller_implicit_upper_bound.php, line 5, character 7 - li
6 |
7 | function rcvr_concrete(B $x): void {}

2 errors found
Original file line number Diff line number Diff line change
Expand Up @@ -306,4 +306,3 @@ File generic_subtyping_caller_upper_bound.php, line 5, character 7 - line 5, cha
6 |
7 | function rcvr_concrete(B $x): void {}

2 errors found
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,3 @@ File generic_subtyping_rcvr_upper_bound.php, line 7, character 32 - line 7, char
10 | rcvr_upper_bound($x);
11 | }

1 error found
Original file line number Diff line number Diff line change
Expand Up @@ -335,4 +335,3 @@ File generic_subtyping_upper_bound.php, line 7, character 32 - line 7, character
10 | rcvr_upper_bound($x);
11 | }

2 errors found
Original file line number Diff line number Diff line change
Expand Up @@ -335,4 +335,3 @@ File generic_subtyping_upper_bound_2.php, line 9, character 32 - line 9, charact
12 | rcvr_both_bounds($x);
13 | }

2 errors found
1 change: 0 additions & 1 deletion hphp/hack/test/extended_reasons/instance_method.php.exp
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,3 @@ File instance_method.php, line 9, character 21 - line 9, character 23:
11 | return $x;
12 | }

1 error found
1 change: 0 additions & 1 deletion hphp/hack/test/extended_reasons/instance_prop.php.exp
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,3 @@ File instance_prop.php, line 7, character 21 - line 7, character 23:
9 | return $x;
10 | }

1 error found
Original file line number Diff line number Diff line change
Expand Up @@ -492,4 +492,3 @@ File intersection_subtyping_l.php, line 7, character 32 - line 7, character 32:
9 | return $c;
10 | }

3 errors found
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,3 @@ File intersection_subtyping_r.php, line 3, character 11 - line 3, character 11:
4 | class A {}
5 | class C extends A {}

1 error found
1 change: 0 additions & 1 deletion hphp/hack/test/extended_reasons/newtype1.php.exp
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,3 @@ File newtype1.php--file2.php, line 3, character 22 - line 3, character 25:
4 | return $x;
5 | }

1 error found
1 change: 0 additions & 1 deletion hphp/hack/test/extended_reasons/num.php.exp
Original file line number Diff line number Diff line change
Expand Up @@ -226,4 +226,3 @@ File num.php, line 3, character 23 - line 3, character 28:
5 | $x = 5 + $x;
6 | $x = $x + 5;

2 errors found
Original file line number Diff line number Diff line change
Expand Up @@ -838,4 +838,3 @@ File optional_sub_newtype_if_unsat.php, line 5, character 14 - line 5, character
8 | foo($x);
9 | }

4 errors found
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,3 @@ File optional_sub_union_if_unsat.php, line 3, character 14 - line 3, character 2
6 | foo($x);
7 | }

1 error found
1 change: 0 additions & 1 deletion hphp/hack/test/extended_reasons/refinement_equal.php.exp
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,3 @@ File refinement_equal.php, line 6, character 36 - line 6, character 36:
10 | $z = $c;
11 | }

1 error found
1 change: 0 additions & 1 deletion hphp/hack/test/extended_reasons/refinment_is.php.exp
Original file line number Diff line number Diff line change
Expand Up @@ -605,4 +605,3 @@ File refinment_is.php, line 7, character 32 - line 7, character 32:
9 | $z = $a;
10 | } else {

3 errors found
1 change: 0 additions & 1 deletion hphp/hack/test/extended_reasons/shape_subtyping_1.php.exp
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,3 @@ File shape_subtyping_1.php, line 4, character 16 - line 4, character 18:
5 | ): void {
6 | }

1 error found
1 change: 0 additions & 1 deletion hphp/hack/test/extended_reasons/shape_subtyping_2.php.exp
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,3 @@ File shape_subtyping_2.php, line 4, character 16 - line 4, character 18:
5 | ): void {
6 | }

1 error found
1 change: 0 additions & 1 deletion hphp/hack/test/extended_reasons/shape_subtyping_3.php.exp
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,3 @@ File shape_subtyping_3.php, line 4, character 16 - line 4, character 18:
5 | ): void {
6 | }

1 error found
1 change: 0 additions & 1 deletion hphp/hack/test/extended_reasons/shape_subtyping_4.php.exp
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,3 @@ File shape_subtyping_4.php, line 3, character 39 - line 3, character 41:
5 |
6 | function expects_required_a_at_int_alias(

1 error found
1 change: 0 additions & 1 deletion hphp/hack/test/extended_reasons/shape_subtyping_5.php.exp
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,3 @@ File shape_subtyping_5.php, line 3, character 39 - line 3, character 41:
5 |
6 | function expects_required_a_at_int_alias(

1 error found
1 change: 0 additions & 1 deletion hphp/hack/test/extended_reasons/shape_subtyping_6.php.exp
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,3 @@ File shape_subtyping_6.php, line 3, character 39 - line 3, character 41:
5 |
6 | function expects_required_a_at_int_alias(

1 error found
1 change: 0 additions & 1 deletion hphp/hack/test/extended_reasons/shape_subtyping_7.php.exp
Original file line number Diff line number Diff line change
Expand Up @@ -308,4 +308,3 @@ File shape_subtyping_7.php, line 3, character 39 - line 3, character 41:
5 |
6 | function expects_required_a_at_int_alias(

2 errors found
1 change: 0 additions & 1 deletion hphp/hack/test/extended_reasons/static_method.php.exp
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,3 @@ File static_method.php, line 9, character 17 - line 9, character 19:
11 | return $x;
12 | }

1 error found
1 change: 0 additions & 1 deletion hphp/hack/test/extended_reasons/static_prop.php.exp
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,3 @@ File static_prop.php, line 7, character 21 - line 7, character 23:
9 | return $x;
10 | }

1 error found
1 change: 0 additions & 1 deletion hphp/hack/test/extended_reasons/union_join_point.php.exp
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,3 @@ File union_join_point.php, line 5, character 37 - line 5, character 37:
7 | $z = $x;
8 | } else{

1 error found
1 change: 0 additions & 1 deletion hphp/hack/test/extended_reasons/union_subtyping_l.php.exp
Original file line number Diff line number Diff line change
Expand Up @@ -318,4 +318,3 @@ File union_subtyping_l.php, line 6, character 32 - line 6, character 32:
7 | return $ab;
8 | }

2 errors found
1 change: 0 additions & 1 deletion hphp/hack/test/extended_reasons/union_subtyping_r.php.exp
Original file line number Diff line number Diff line change
Expand Up @@ -440,4 +440,3 @@ File union_subtyping_r.php, line 3, character 7 - line 3, character 7:
5 | <<__NoAutoLikes>>
6 | function union_r(C $c): (A|B) {

3 errors found
1 change: 0 additions & 1 deletion hphp/hack/test/extended_reasons/vector_invariant.php.exp
Original file line number Diff line number Diff line change
Expand Up @@ -278,4 +278,3 @@ File vector_invariant.php, line 3, character 24 - line 3, character 26:
6 | $z = $y;
7 | // hh_force_solve();

1 error found
1 change: 0 additions & 1 deletion hphp/hack/test/extended_reasons/vector_invariant_2.php.exp
Original file line number Diff line number Diff line change
Expand Up @@ -364,4 +364,3 @@ File vector_invariant_2.php, line 10, character 7 - line 10, character 7:
9 |
10 | class »A« {}

2 errors found

0 comments on commit 4cf06f1

Please sign in to comment.