Reject --disable-promotion in dune fmt and dune promotion apply#14379
Draft
Copilot wants to merge 1 commit into
Draft
Reject --disable-promotion in dune fmt and dune promotion apply#14379Copilot wants to merge 1 commit into
--disable-promotion in dune fmt and dune promotion apply#14379Copilot wants to merge 1 commit into
Conversation
#5946) Agent-Logs-Url: https://github.com/ocaml/dune/sessions/fc5049e9-c3d3-4c1f-bbc4-761bf92b393a Co-authored-by: Alizter <8614547+Alizter@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
Alizter
April 30, 2026 01:51
View session
Collaborator
|
@copilot Which issue does this fix? Please update the PR description. |
Contributor
Author
Collaborator
|
Seems like a sensible fix to me. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
dune fmtignores--disable-promotionflag #5946dune fmtsilently ignored--disable-promotion(overriding it internally withAutomatically), anddune promotion applyaccepted it without complaint — both are nonsensical combinations since these commands exist specifically to perform promotion.Changes
bin/common.ml/bin/common.mli: Expose apromoteaccessor onCommon.Builderso callers can inspect the parsed promotion flag before it is overridden.bin/fmt.ml: Raise aUser_errorif--disable-promotionis passed, directing users to--previewinstead.bin/promotion.ml: Raise aUser_errorif--disable-promotionis passed todune promotion apply.test/…/promote/disable-promotion.t/run.t: Add cram test cases covering both rejection paths.Note: the check also fires when
--disable-promotion's backing env varDUNE_DISABLE_PROMOTIONis set, since both map to the samePromote.Nevervalue.