ocaml/dune

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

Ouverte

#3 271 ouverte le 16 mars 2020

 (11 commentaires) (0 réaction) (0 personne assignée)OCaml (478 forks)github user discovery
enhancementgood first issue

Métriques du dépôt

Stars
 (1 882 étoiles)
Métriques de merge PR
 (Merge moyen 1j 20h) (345 PRs mergées en 30 j)

Description

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.

Guide contributeur