Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: move cram stanza definition #6800

Merged
merged 1 commit into from
Dec 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/dune_rules/cram_rules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ let rules ~sctx ~expander ~dir tests =
| None -> []
| Some (d : Dune_file.t) ->
List.filter_map d.stanzas ~f:(function
| Dune_file.Cram c -> Option.some_if (f c) (dir, c)
| Cram_stanza.T c -> Option.some_if (f c) (dir, c)
| _ -> None)
in
let rec collect_whole_subtree acc dir =
Expand Down
2 changes: 2 additions & 0 deletions src/dune_rules/cram_stanza.ml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ type t =
; package : Package.t option
}

type Stanza.t += T of t

let decode =
fields
(let+ loc = loc
Expand Down
2 changes: 2 additions & 0 deletions src/dune_rules/cram_stanza.mli
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ type t =
; package : Package.t option
}

type Stanza.t += T of t

val decode : t Dune_lang.Decoder.t
3 changes: 1 addition & 2 deletions src/dune_rules/dune_file.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2245,7 +2245,6 @@ type Stanza.t +=
| Toplevel of Toplevel.t
| Library_redirect of Library_redirect.Local.t
| Deprecated_library_name of Deprecated_library_name.t
| Cram of Cram_stanza.t
| Plugin of Plugin.t

module Stanzas = struct
Expand Down Expand Up @@ -2354,7 +2353,7 @@ module Stanzas = struct
"You can enable cram tests by adding (cram enable) to your \
dune-project file."
];
[ Cram t ] )
[ Cram_stanza.T t ] )
; ( "generate_sites_module"
, let+ () = Dune_lang.Syntax.since Section.dune_site_syntax (0, 1)
and+ t = Generate_sites_module_stanza.decode in
Expand Down
1 change: 0 additions & 1 deletion src/dune_rules/dune_file.mli
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,6 @@ type Stanza.t +=
| Toplevel of Toplevel.t
| Library_redirect of Library_redirect.Local.t
| Deprecated_library_name of Deprecated_library_name.t
| Cram of Cram_stanza.t
| Plugin of Plugin.t

val stanza_package : Stanza.t -> Package.t option
Expand Down