File tree 6 files changed +25
-6
lines changed
6 files changed +25
-6
lines changed Original file line number Diff line number Diff line change 2
2
3
3
### Added
4
4
5
+ - Add flag to ` dune-release check ` that attempts to discover and parse the
6
+ change log. (#458 , @gridbugs )
7
+
5
8
### Changed
6
9
7
10
### Deprecated
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ let clone_and_checkout_tag repo ~dir ~tag =
15
15
let check (`Package_names pkg_names ) (`Package_version version ) (`Dist_tag tag )
16
16
(`Keep_v keep_v ) (`Build_dir build_dir ) (`Skip_lint skip_lint )
17
17
(`Skip_build skip_build ) (`Skip_tests skip_tests )
18
- (`Working_tree on_working_tree ) =
18
+ (`Check_change_log check_change_log ) (` Working_tree on_working_tree ) =
19
19
(let dir, clean_up =
20
20
if on_working_tree then (OS.Dir. current () , fun _ -> () )
21
21
else
@@ -46,7 +46,7 @@ let check (`Package_names pkg_names) (`Package_version version) (`Dist_tag tag)
46
46
Config. keep_v ~keep_v >> = fun keep_v ->
47
47
let check_result =
48
48
Check. check_project ~pkg_names ?tag ?version ~keep_v ?build_dir ~skip_lint
49
- ~skip_build ~skip_tests ~dir ()
49
+ ~skip_build ~skip_tests ~check_change_log ~ dir ()
50
50
in
51
51
let () = clean_up dir in
52
52
check_result)
@@ -80,7 +80,7 @@ let term =
80
80
Term. (
81
81
const check $ Cli. pkg_names $ Cli. pkg_version $ Cli. dist_tag $ Cli. keep_v
82
82
$ Cli. build_dir $ Cli. skip_lint $ Cli. skip_build $ Cli. skip_tests
83
- $ working_tree)
83
+ $ Cli. check_change_log $ working_tree)
84
84
85
85
let info = Cmd. info " check" ~doc ~man
86
86
let cmd = Cmd. v info term
Original file line number Diff line number Diff line change @@ -256,6 +256,12 @@ let skip_tests =
256
256
in
257
257
named (fun x -> `Skip_tests x) Arg. (value & flag & info [ " skip-tests" ] ~doc )
258
258
259
+ let check_change_log =
260
+ let doc = " Check that the change log can be parsed" in
261
+ named
262
+ (fun x -> `Check_change_log x)
263
+ Arg. (value & flag & info [ " check-change-log" ] ~doc )
264
+
259
265
let keep_build_dir =
260
266
let doc =
261
267
" Keep the distribution build directory after successful archival."
Original file line number Diff line number Diff line change @@ -105,6 +105,9 @@ val skip_build : [> `Skip_build of bool ] Term.t
105
105
val skip_tests : [> `Skip_tests of bool ] Term .t
106
106
(* * a [--skip-test] option to skip checking the tests *)
107
107
108
+ val check_change_log : [> `Check_change_log of bool ] Term .t
109
+ (* * a [--check-change-log] option to force validation of change-log *)
110
+
108
111
val keep_build_dir : [> `Keep_build_dir of bool ] Term .t
109
112
(* * a [--keep-build-dir] flag to keep the build directory used for the archive
110
113
check. *)
Original file line number Diff line number Diff line change @@ -88,8 +88,11 @@ let dune_project_check dir =
88
88
in
89
89
R. join @@ Sos. with_dir ~dry_run: false dir check ()
90
90
91
- let check_project ~pkg_names ~skip_lint ~skip_build ~skip_tests ?tag ?version
92
- ~keep_v ?build_dir ~dir () =
91
+ let change_log_check pkg =
92
+ Pkg. change_log pkg >> = Text. change_log_file_last_entry >> | Fun. const 0
93
+
94
+ let check_project ~pkg_names ~skip_lint ~skip_build ~skip_tests
95
+ ~check_change_log ?tag ?version ~keep_v ?build_dir ~dir () =
93
96
match pkg_creation_check ?tag ?version ~keep_v ?build_dir dir with
94
97
| Error (`Msg err ) ->
95
98
App_log. report_status `Fail (fun m -> m " %s" err);
@@ -102,5 +105,8 @@ let check_project ~pkg_names ~skip_lint ~skip_build ~skip_tests ?tag ?version
102
105
>> = fun dune_exit ->
103
106
(if skip_lint then Ok 0
104
107
else Lint. lint_packages ~dry_run: false ~dir ~todo: Lint. all pkg pkg_names)
105
- >> | fun lint_exit ->
108
+ >> = fun lint_exit ->
109
+ (if check_change_log then change_log_check pkg else Ok 0 )
110
+ >> | fun change_log_exit ->
106
111
opam_file_exit + dune_project_exit + dune_exit + lint_exit
112
+ + change_log_exit
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ val check_project :
16
16
skip_lint :bool ->
17
17
skip_build :bool ->
18
18
skip_tests :bool ->
19
+ check_change_log :bool ->
19
20
?tag : Vcs.Tag .t ->
20
21
?version : Version .t ->
21
22
keep_v :bool ->
You can’t perform that action at this time.
0 commit comments