ocaml/dune

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

オープン

#3,271 opened on 2020/03/16

 (11 件のコメント) (0 件のリアクション) (0 人の担当者)OCaml (478 件のフォーク)github user discovery
enhancementgood first issue

Repository metrics

Stars
 (1,882 個のスター)
PR merge metrics
 (平均マージ 1d 20h) (30d で 345 merged PRs)

説明

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.

コントリビューターガイド