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

Factor out rule targets into a separate module #5048

Merged
merged 1 commit into from
Oct 25, 2021

Conversation

snowleopard
Copy link
Collaborator

@snowleopard snowleopard commented Oct 23, 2021

A refactoring in preparation of #5025.

  • Create a new module Targets for representing rule targets. For now, it only represents file targets but the interface is designed to extend the module to support directory targets too. For example, various function arguments are called ~file instead of more usual ~f because directory targets will require a new argument ~dir.
  • Rename Dune_rules.Targets to Dune_rules.Targets_spec to avoid confusion.

The only slight change of behaviour is around pretty printing of targets in an error message in rule.ml: it used to simply turn paths into a string but the new Targets.pp uses Dpath.describe_target as in other places where we pretty print targets.

@snowleopard snowleopard requested review from rgrinberg, a user and cwong-ocaml October 23, 2021 13:54
@snowleopard snowleopard force-pushed the factor-out-targets branch 3 times, most recently from 2cb7946 to 43e887f Compare October 23, 2021 14:33
@snowleopard snowleopard merged commit d178570 into ocaml:main Oct 25, 2021
@snowleopard snowleopard deleted the factor-out-targets branch October 25, 2021 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants