Skip to content

Commit

Permalink
Merge pull request #32 from tmcgilchrist/hint_strings
Browse files Browse the repository at this point in the history
Add quoted fix suggestion string.
  • Loading branch information
talex5 authored Jul 5, 2021
2 parents 28c5f0d + a642fae commit ce37d86
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions tests/test_dune.t
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ Create a simple dune project:
$ touch main.ml test.ml
$ dune build

Replace all version numbers with "1.0" to get predictable outut.
Replace all version numbers with "1.0" to get predictable output.

$ export OPAM_DUNE_LINT_TESTS=y

Check that the missing libraries are detected:

$ opam-dune-lint </dev/null
test.opam: changes needed:
"fmt" {>= 1.0} [from /]
"bos" {with-test & >= 1.0} [from /]
"opam-state" {with-test & >= 1.0} [from /]
"fmt" {>= "1.0"} [from /]
"bos" {with-test & >= "1.0"} [from /]
"opam-state" {with-test & >= "1.0"} [from /]
Note: version numbers are just suggestions based on the currently installed version.
Run with -f to apply changes in non-interactive mode.
[1]
Expand All @@ -45,9 +45,9 @@ Check that the missing libraries get added:

$ opam-dune-lint -f
test.opam: changes needed:
"fmt" {>= 1.0} [from /]
"bos" {with-test & >= 1.0} [from /]
"opam-state" {with-test & >= 1.0} [from /]
"fmt" {>= "1.0"} [from /]
"bos" {with-test & >= "1.0"} [from /]
"opam-state" {with-test & >= "1.0"} [from /]
Note: version numbers are just suggestions based on the currently installed version.
Wrote "dune-project"

Expand Down
2 changes: 1 addition & 1 deletion tests/test_vendoring.t
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ on "bos":
$ opam-dune-lint </dev/null
main.opam: changes needed:
"ocamlfind" {>= 1.0} [from lib]
"ocamlfind" {>= "1.0"} [from lib]
Note: version numbers are just suggestions based on the currently installed version.
Run with -f to apply changes in non-interactive mode.
[1]
4 changes: 2 additions & 2 deletions types.ml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ module Change_with_hint = struct
match c with
| `Remove_with_test name -> Fmt.str "%a" pp_name name, ["(remove {with-test})"]
| `Add_with_test name -> Fmt.str "%a {with-test}" pp_name name, ["(missing {with-test} annotation)"]
| `Add_build_dep dep -> Fmt.str "%a {>= %s}" pp_name (OpamPackage.name dep) (version_to_string dep), []
| `Add_test_dep dep -> Fmt.str "%a {with-test & >= %s}" pp_name (OpamPackage.name dep) (version_to_string dep), []
| `Add_build_dep dep -> Fmt.str "%a {>= \"%s\"}" pp_name (OpamPackage.name dep) (version_to_string dep), []
| `Add_test_dep dep -> Fmt.str "%a {with-test & >= \"%s\"}" pp_name (OpamPackage.name dep) (version_to_string dep), []
in
let hint =
if Dir_set.is_empty dirs then hint
Expand Down

0 comments on commit ce37d86

Please sign in to comment.