Skip to content

Commit d911ca6

Browse files
Error messages cleanup: Don't please the user (#7833)
1 parent 5cc3938 commit d911ca6

File tree

9 files changed

+11
-12
lines changed

9 files changed

+11
-12
lines changed

compiler/bsb/bsb_exception.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ let print (fmt : Format.formatter) (x : error) =
5252
"File \"rescript.json\", line 1\n\
5353
@{<error>Error:@} package @{<error>%s@} is not found\n\
5454
It's the basic, required package. If you have it installed globally,\n\
55-
Please run `npm link rescript` to make it available"
55+
Run `npm link rescript` to make it available."
5656
name
5757
else
5858
Format.fprintf fmt
@@ -64,7 +64,7 @@ let print (fmt : Format.formatter) (x : error) =
6464
Format.fprintf fmt
6565
"File %S, line %d:\n\
6666
@{<error>Error:@} %s \n\
67-
For more details, please check out the schema at \
67+
For more details, check out the schema at \
6868
https://rescript-lang.org/docs/manual/latest/build-configuration-schema"
6969
pos.pos_fname pos.pos_lnum s
7070
| Invalid_spec s ->

compiler/core/js_packages_info.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ let get_output_dir (info : t) ~package_dir module_system =
183183

184184
let add_npm_package_path (packages_info : t) (s : string) : t =
185185
if is_empty packages_info then
186-
Bsc_args.bad_arg "please set package name first using -bs-package-name "
186+
Bsc_args.bad_arg "Set package name first using -bs-package-name"
187187
else
188188
let handle_module_system module_system =
189189
match module_system_of_string module_system with

compiler/depends/bs_exception.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ let report_error ppf = function
6464
| Bs_main_not_exist main -> Format.fprintf ppf "File %s not found " main
6565
| Bs_package_not_found package ->
6666
Format.fprintf ppf
67-
"Package %s not found or %s/lib/ocaml does not exist or please set \
67+
"Package %s not found or %s/lib/ocaml does not exist or set \
6868
npm_config_prefix correctly"
6969
package package
7070
| Bs_invalid_path path -> Format.pp_print_string ppf ("Invalid path: " ^ path)

compiler/ext/warnings.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,11 +423,11 @@ let message = function
423423
| Unused_rec_flag -> "unused rec flag."
424424
| Ambiguous_name ([s], tl, false) ->
425425
s ^ " belongs to several types: " ^ String.concat " " tl
426-
^ "\nThe first one was selected. Please disambiguate if this is wrong."
426+
^ "\nThe first one was selected. Disambiguate if this is wrong."
427427
| Ambiguous_name (_, _, false) -> assert false
428428
| Ambiguous_name (_slist, tl, true) ->
429429
"these field labels belong to several types: " ^ String.concat " " tl
430-
^ "\nThe first one was selected. Please disambiguate if this is wrong."
430+
^ "\nThe first one was selected. Disambiguate if this is wrong."
431431
| Nonoptional_label s -> "the label " ^ s ^ " is not optional."
432432
| Open_shadow_identifier (kind, s) ->
433433
Printf.sprintf

compiler/frontend/bs_ast_invariant.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ let emit_external_warnings : iterator =
8686
[{ptype_kind = Ptype_variant ({pcd_res = Some _} :: _)}] ) ->
8787
Location.raise_errorf ~loc:str_item.pstr_loc
8888
"GADTs require recursive type syntax.\n\
89-
Please define your type using `type rec` instead of `type`.\n\
89+
Define your type using `type rec` instead of `type`.\n\
9090
Example: type rec t = ..."
9191
| _ -> super.structure_item self str_item);
9292
expr =

compiler/ml/typemod.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1821,7 +1821,7 @@ let report_error ppf = function
18211821
| Cannot_eliminate_dependency mty ->
18221822
fprintf ppf
18231823
"@[This functor has type@ %a@ The parameter cannot be eliminated in the \
1824-
result type.@ Please bind the argument to a module identifier.@]"
1824+
result type.@ Bind the argument to a module identifier.@]"
18251825
modtype mty
18261826
| Signature_expected -> fprintf ppf "This module type is not a signature"
18271827
| Structure_expected mty ->

compiler/syntax/src/jsx_v4.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -809,8 +809,7 @@ let map_binding ~config ~empty_loc ~pstr_loc ~file_name ~rec_flag binding =
809809
| Pexp_fun {arg_label = Labelled _ | Optional _} ->
810810
Location.raise_errorf ~loc:expr.pexp_loc
811811
"Components using React.forwardRef cannot use \
812-
@react.componentWithProps. Please use @react.component \
813-
instead."
812+
@react.componentWithProps. Use @react.component instead."
814813
| Pexp_fun {arg_label = Nolabel; rhs = body} ->
815814
check_invalid_forward_ref body
816815
| _ -> ()

tests/build_tests/super_errors/expected/gadt_rec_missing.res.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
9 │
1313

1414
GADTs require recursive type syntax.
15-
Please define your type using `type rec` instead of `type`.
15+
Define your type using `type rec` instead of `type`.
1616
Example: type rec t = ...

tests/build_tests/super_errors/expected/react_component_with_props.res.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
14 │ )
1313
15 │ }
1414

15-
Components using React.forwardRef cannot use @react.componentWithProps. Please use @react.component instead.
15+
Components using React.forwardRef cannot use @react.componentWithProps. Use @react.component instead.

0 commit comments

Comments
 (0)