cue icon indicating copy to clipboard operation
cue copied to clipboard

modules: support for .cueignore

Open rogpeppe opened this issue 1 year ago • 5 comments

As described in #2992 by @ptr1120, sometimes we might want a way to exclude arbitrary files from a CUE module.

To quote that comment:

Regarding .cueignore, I am still a proponent of the ability to explicitly ignore items that are in Git but should not be part of the module. For example, there can be various settings related to IDEs, VCS, and other tools that are version-controlled but would not be appropriate for inclusion in a module. Additionally, I often have shell scripts, CUE tools, and possibly some tests written in CUE which I hope can be excluded.

This issue tracks that feature request.

rogpeppe avatar Apr 22 '24 17:04 rogpeppe

+1 from me, I'd also find this useful. My use case is that I have a big repository that contains an OpenAPI YAML spec along with a bunch of other things. I'm trying to publish a cue module for this YAML spec, but I only want my generated cue file to be included and nothing else.

Anyway, while this would be nice to have, I can work around this for now.

felixge avatar Jun 10 '24 20:06 felixge

@felixge - thanks for the input. Yours sounds more like an explicit include list situation?

myitcv avatar Jun 12 '24 21:06 myitcv

@felixge - thanks for the input. Yours sounds more like an explicit include list situation?

... or perhaps a case where exactly the contents of the directory that are relevant for CUE evaluation are included but nothing else?

rogpeppe avatar Jun 13 '24 15:06 rogpeppe

+1 for that feature, in my case I'm interested into defining 'unit' tests for a module that I would not like to be published along with it.

AntoineThebaud avatar Mar 21 '25 14:03 AntoineThebaud

Go has done this now with an "ignore" directive in go.mod: https://github.com/golang/go/issues/42965

I would suggest that we consider the same approach - either an include or an exclude list in cue.mod/module.cue - so that we don't introduce more special files which are likely to pollute the root of VCS directories.

mvdan avatar May 30 '25 18:05 mvdan