ocaml/dune

Ability to control the meaning of :standard dirs at workspace level.

開放

#3,271 建立於 2020年3月16日

 (11 則留言) (0 個反應) (0 位負責人)OCaml (478 個分叉)github user discovery
enhancementgood first issue

倉庫指標

星標
 (1,882 顆星)
PR 合併指標
 (平均合併 1天 20小時) (30 天內合併 345 個 PR)

描述

Currently directories with leading underscores are ignored by dune by default, even in cases when specifying (include_subdirs unqualified). There is a pattern in the JS community with the most popular testing library (Jest), where developers put a directory called __tests__ right next to the code that it tests. That pattern doesn't translate to Dune because it ignores all directories with a leading underscore. There are ways around it, but there are some downsides to those workarounds.

  • Each dune file that has tests has to remember to include __tests__ in its (dirs).
  • (dirs) isn't respected when it is generated using the "include" or Tuareg mode features.

I might suggest it would be better if Dune was not so opinionated to ignore directories starting with underscore, but that's probably a more invasive breaking change.

Instead, could we allow projects to specify at the dune-project or dune-workspace level, the meaning of :standard dirs? For example, you could override the default definition of :standard. Right now standard is a regex [^_\.].*, but this could be overridden so be .* for this Jest style pattern.

貢獻者指南