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

Doublestar excludes doesn't seem to work: #97

Closed
esn89 opened this issue Mar 24, 2023 · 25 comments · Fixed by #105 or #124
Closed

Doublestar excludes doesn't seem to work: #97

esn89 opened this issue Mar 24, 2023 · 25 comments · Fixed by #105 or #124

Comments

@esn89
Copy link

esn89 commented Mar 24, 2023

I have this:

doublestar: true
exclude:
  - **/templates/**
formatter:
  type: basic
  indent: 2
  include_document_start: true

And I am doing this to prevent the yamlfmt from formatting my templates/ folder that are in my helm charts, since it messes everything up.

However, it keeps complaining that:
2023/03/24 14:38:02 yaml: line 3: did not find expected alphabetic or numeric character.

So I put line 3 in quotes "- **/templates/**" and now the error goes away. However, it doesn't respect my excludes and continues to format things in the templates/ folder.

@braydonk
Copy link
Collaborator

Hi @esn89, thanks for opening an issue!

Firstly, that error: 2023/03/24 14:38:02 yaml: line 3: did not find expected alphabetic or numeric character
The YAML specification requires that strings without " (double quotes) start with an alphanumeric character, which * is not. To start a string with *, you do need to quote it.

If you quoted it in the manner you mentioned in the last sentence, like "- **/templates/**", that will cause the yaml to parse, but because your quote includes the -, it will cause the whole thing not to parse quite right; that ends up becoming a single string, not an array with a single string in it.

As for finding a config that will work, I messed with something locally and I have something that seems to work.

Firstly, my folder structure was that I had a tmp folder with yaml files in it, and one subfolder called templates with more yaml files in it. This was the config I used:

doublestar: true
include:
- "tmp/**/*.yaml"
exclude:
- "**/templates/**"

This configuration caused yamlfmt to properly ignore the yaml files in templates as expected. Hopefully this will work for you!

@esn89
Copy link
Author

esn89 commented Mar 25, 2023

Thanks, let me give this one a try :)

@esn89
Copy link
Author

esn89 commented Mar 25, 2023

Thanks for the detailed explanation, @braydonk. It works.

@esn89 esn89 closed this as completed Mar 25, 2023
@braydonk
Copy link
Collaborator

Awesome! Enjoy 🚀

@esn89
Copy link
Author

esn89 commented Mar 27, 2023

@braydonk
Actually, it still doesn't seem to work (again):

- "/Users/ev/Documents/Projects/**/templates/**"
- "/Users/ev/**/.gitlab-ci.yml"

For the .gitlab-ci.yml here:

/Users/ev/Documents/Projects/coolproject/.gitlab-ci.yml it is formatting it.

@esn89 esn89 reopened this Mar 27, 2023
@braydonk
Copy link
Collaborator

I'm assuming this is on Windows with a path like /Users?

This seems to be a bug in the doublestar library yamlfmt uses. Absolute paths on Windows don't appear to match properly, or there's some edge case to them that I don't understand. I'll look into it.

As a workaround, I tried just doing **/.gitlab-ci.yml and that seemed to work for me on Windows.

@esn89
Copy link
Author

esn89 commented Mar 29, 2023

@braydonk

This is on MacOS. I am wondering if I need to explicitly install the doublestar go package?

I have it set up like this, (in case you're also using Null-ls):

                    formatting.yamlfmt.with({ extra_args = { '-conf=/Users/ev/.config/nvim/.yamlfmt' } }),

@braydonk
Copy link
Collaborator

Shouldn't need to install the doublestar Go package. It's bundled in directly with the yamlfmt binary.

I don't have a Mac machine to test myself, but I have observed it on Windows at least. I'll look into it, chances are since it's happening on Mac as well it's something in the general package and not platform specific.

@braydonk
Copy link
Collaborator

braydonk commented Apr 1, 2023

The issue was that I wasn't matching using absolute paths in doublestar mode. This should work in the next release.

@esn89
Copy link
Author

esn89 commented Apr 2, 2023

Thank you @braydonk :) Looking forward.

@esn89
Copy link
Author

esn89 commented Apr 2, 2023

Hey @braydonk and @badouralix, hate to be a nag, but this is not working with my current config:

doublestar: true
exclude:
  - "/Users/ev/Documents/Projects/**/templates/**"
  - "/Users/ev/Documents/Projects/**/.gitlab-ci.yml"
formatter:
  type: basic
  indent: 2
  include_document_start: true

The file:

~/Documents/Projects/supercool/.gitlab-ci.yml

The contents:

default:
  image:
    name: foo

stages:
  - plan
  - destroy
  - deploy

The command I ran:

./yamlfmt -conf=/Users/ev/.config/nvim/.yamlfmt ~/Documents/Projects/supercool/.gitlab-ci.yml

On Mac OS 13.3

@badouralix
Copy link
Contributor

I faced a similar issue with --exclude "**/templates/**" on Mac OS 13.3 too even with the latest release of yamlfmt
I'll try to get some time to figure out why this is happening

@braydonk
Copy link
Collaborator

braydonk commented Apr 3, 2023

That's very frustrating, I don't know what could be happening. I tested this on Linux and Windows and haven't found a scenario where it doesn't work as it should. It feels very unlikely that it's something Mac specific, but I can't say for sure without having one to test.

Another possibility is that this has something to do with using yamlfmt as a standalone binary, which is something I don't test extensively because I never expect it to have any difference. I'll try that and see if I get any different results.

Sorry this has been painful to get working, I really thought it was fixed. Hopefully we can get to the bottom of this.

@braydonk braydonk reopened this Apr 3, 2023
@braydonk
Copy link
Collaborator

braydonk commented Apr 3, 2023

Even as a standalone binary on Linux and Windows my standalone reproducer worked. If someone with a Mac could give this exact scenario a try and see if there's a different result that would be great.

  • Install yamlfmt v0.9.0
  • Make a directory temp
  • Inside temp make a .yamlfmt config like so:
doublestar: true
exclude:
- "/Users/username/**/x.yaml"
  • Make a file in the folder called x.yaml, make sure that it's something that is guaranteed to need formatting like so:
a:
 b: 1
  • In temp, run the command yamlfmt -dry -quiet x.yaml

When I use this setup with the exclude pattern adapted for Linux and Windows but using full absolute paths, I get the following output:

2023/04/03 08:59:14 No files will be changed.

When I comment out the exclude from the .yamlfmt I get:

2023/04/03 09:46:44 The following files will have formatting changes:

x.yaml

I think this scenario should be similarly matching the scenario described above. I'm hoping for someone to replicate this exact version of the scenario on Mac just so I can confirm whether my experiment is flawed or there's genuinely a difference on Mac.

@badouralix
Copy link
Contributor

Never mind, I forgot to add --dstart in my previous attempt...
I tested the exact scenario above on macos, and got this as expected

2023/04/03 23:39:39 No files will be changed.

And after commenting the exclude

2023/04/03 23:39:49 The following files will have formatting changes:

x.yaml

It would be nice to have yamlfmt --version and yamlfmt --verbose for debugging purposes


@esn89 would you be able to run this command please ?

go version -m $(which yamlfmt)

Here is what I have on an install with brew install badouralix/tap/yamlfmt

/opt/homebrew/bin/yamlfmt: go1.20.2
	path	github.com/google/yamlfmt/cmd/yamlfmt
	mod	github.com/google/yamlfmt	(devel)
	dep	github.com/RageCage64/multilinediff	v0.2.0	h1:yNSpSF5NXIrmo6bRIgO4Q0g7SXqFD4j/WEcBE+BdCFY=
	dep	github.com/bmatcuk/doublestar/v4	v4.6.0	h1:HTuxyug8GyFbRkrffIpzNCSK4luc0TY3wzXvzIZhEXc=
	dep	github.com/braydonk/yaml	v0.7.0	h1:ySkqO7r0MGoCNhiRJqE0Xe9yhINMyvOAB3nFjgyJn2k=
	dep	github.com/google/go-cmp	v0.5.9	h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
	dep	github.com/mitchellh/mapstructure	v1.5.0	h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
	build	-buildmode=exe
	build	-compiler=gc
	build	-trimpath=true
	build	CGO_ENABLED=1
	build	GOARCH=arm64
	build	GOOS=darwin

@esn89
Copy link
Author

esn89 commented Apr 4, 2023

Here you are @badouralix

yamlfmt: go1.18.10
	path	github.com/google/yamlfmt/cmd/yamlfmt
	mod	github.com/google/yamlfmt	(devel)	
	dep	github.com/RageCage64/multilinediff	v0.2.0	h1:yNSpSF5NXIrmo6bRIgO4Q0g7SXqFD4j/WEcBE+BdCFY=
	dep	github.com/bmatcuk/doublestar/v4	v4.6.0	h1:HTuxyug8GyFbRkrffIpzNCSK4luc0TY3wzXvzIZhEXc=
	dep	github.com/braydonk/yaml	v0.7.0	h1:ySkqO7r0MGoCNhiRJqE0Xe9yhINMyvOAB3nFjgyJn2k=
	dep	github.com/google/go-cmp	v0.5.9	h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
	dep	github.com/mitchellh/mapstructure	v1.5.0	h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
	build	-compiler=gc
	build	-ldflags="-s -w -X main.version=0.9.0 -X main.commit=3a03733ec9d76beb574b0aeeae44b3e06c87ef04 -X main.date=2023-04-02T15:04:20Z -X main.builtBy=goreleaser"
	build	CGO_ENABLED=0
	build	GOARCH=amd64
	build	GOOS=darwin
	build	GOAMD64=v1
	build	vcs=git
	build	vcs.revision=3a03733ec9d76beb574b0aeeae44b3e06c87ef04
	build	vcs.time=2023-04-02T14:21:20Z
	build	vcs.modified=false
	```

badouralix added a commit to badouralix/google-yamlfmt that referenced this issue Apr 9, 2023
@badouralix
Copy link
Contributor

badouralix commented Apr 9, 2023

Your version of yamlfmt seems up to date with all correct dependencies. Odd... I am still unsure how it behaves this way.
I have added some debug logs in badouralix@837b28e to help us investigate this further.
Can you retry using these commands instead ?

git clone -b debug-issue-97 https://github.com/badouralix/google-yamlfmt
cd google-yamlfmt
# Here replace the usual `yamlfmt ...` with `go run ./cmd/yamlfmt ...`
go run ./cmd/yamlfmt -conf=/Users/ev/.config/nvim/.yamlfmt ~/Documents/Projects/supercool/.gitlab-ci.yml

The new debug lines start with [DEBUG ISSUE 97].

@rhbuf
Copy link

rhbuf commented Apr 10, 2023

@badouralix I'm experiencing the same issue with doublestar (fails on my Apple M1 running MacOS Ventura 13.2.1 and also on our Ubuntu 22.04 Github runner). I tried your branch with the following:

google-yamlfmt/
  temp/
    .yamlfmt
    one/
      two/
        x.yml

the contents of .yamlfmt:

doublestar: true
exclude:
- "/Users/ross/projects/google-yamlfmt/temp/**/x.yaml"

and x.yml is the same invalid yaml file as above

Here are the logs:

$ pwd
/Users/ross/projects/google-yamlfmt
$ go run ./cmd/yamlfmt -conf=./temp/.yamlfmt 'temp/**/*.{yaml,yml}'
[DEBUG ISSUE 97] c.Config=&command.Config{Extensions:[]string{"yaml", "yml"}, Include:[]string{"temp/**/*.{yaml,yml}"}, Exclude:[]string{"/Users/ross/projects/google-yamlfmt/temp/**/x.yaml"}, RegexExclude:[]string(nil), Doublestar:true, LineEnding:"lf", FormatterConfig:(*command.FormatterConfig)(0x140001a01b0)}
[DEBUG ISSUE 97] c.Config.FormatterConfig=&command.FormatterConfig{Type:"", FormatterSettings:map[string]interface {}{"line_ending":"lf"}}
[DEBUG ISSUE 97] collector=&yamlfmt.DoublestarCollector{Include:[]string{"temp/**/*.{yaml,yml}"}, Exclude:[]string{"/Users/ross/projects/google-yamlfmt/temp/**/x.yaml"}}
[DEBUG ISSUE 97] entered doublestar collector
[DEBUG ISSUE 97] includedPaths=[]string{"temp/one/two/x.yml"}
[DEBUG ISSUE 97] no match pattern="/Users/ross/projects/google-yamlfmt/temp/**/x.yaml" absPath="/Users/ross/projects/google-yamlfmt/temp/one/two/x.yml"
[DEBUG ISSUE 97] included because not excluded path="temp/one/two/x.yml"
[DEBUG ISSUE 97] collect paths returned collectedPaths=[]string{"temp/one/two/x.yml"}
[DEBUG ISSUE 97] analyze paths returned paths=[]string{"temp/one/two/x.yml"}

Even with a relative path this fails, config file:

doublestar: true
exclude:
- "**/x.yaml"

Logs:

go run ./cmd/yamlfmt -conf=./temp/.yamlfmt 'temp/**/*.{yaml,yml}'
[DEBUG ISSUE 97] c.Config=&command.Config{Extensions:[]string{"yaml", "yml"}, Include:[]string{"temp/**/*.{yaml,yml}"}, Exclude:[]string{"**/x.yaml"}, RegexExclude:[]string(nil), Doublestar:true, LineEnding:"lf", FormatterConfig:(*command.FormatterConfig)(0x1400000c1c8)}
[DEBUG ISSUE 97] c.Config.FormatterConfig=&command.FormatterConfig{Type:"", FormatterSettings:map[string]interface {}{"line_ending":"lf"}}
[DEBUG ISSUE 97] collector=&yamlfmt.DoublestarCollector{Include:[]string{"temp/**/*.{yaml,yml}"}, Exclude:[]string{"**/x.yaml"}}
[DEBUG ISSUE 97] entered doublestar collector
[DEBUG ISSUE 97] includedPaths=[]string{"temp/one/two/x.yml"}
[DEBUG ISSUE 97] no match pattern="**/x.yaml" absPath="/Users/ross/projects/google-yamlfmt/temp/one/two/x.yml"
[DEBUG ISSUE 97] included because not excluded path="temp/one/two/x.yml"
[DEBUG ISSUE 97] collect paths returned collectedPaths=[]string{"temp/one/two/x.yml"}
[DEBUG ISSUE 97] analyze paths returned paths=[]string{"temp/one/two/x.yml"}

Hope this helps, everything was working fine for us up until v0.9.0 (rolling back to v0.8.0 works, but we want to take advantage of the content-based exclusions that were added)

@badouralix
Copy link
Contributor

@rhbuf in your case, the excluded file is x.yaml, but the actual file name is x.yml
This explains why there is no match here below :

[DEBUG ISSUE 97] no match pattern="**/x.yaml" absPath="/Users/ross/projects/google-yamlfmt/temp/one/two/x.yml"

Maybe this .yamlfmt would work instead ?

doublestar: true
exclude:
- "**/x.yaml"
- "**/x.yml"

But now we need to investigate why it was working fine with v0.8.0 😵‍💫

@rhbuf
Copy link

rhbuf commented Apr 10, 2023

@badouralix sorry my bad - I've amended my .yamlfmt file and it works now:

go run ./cmd/yamlfmt -conf=./temp/.yamlfmt -dstar './temp/**/*{yaml,yml}'
[DEBUG ISSUE 97] c.Config=&command.Config{Extensions:[]string{"yaml", "yml"}, Include:[]string{"./temp/**/*{yaml,yml}"}, Exclude:[]string{"**/x.yml"}, RegexExclude:[]string(nil), Doublestar:true, LineEnding:"lf", FormatterConfig:(*command.FormatterConfig)(0x1400000c1e0)}
[DEBUG ISSUE 97] c.Config.FormatterConfig=&command.FormatterConfig{Type:"", FormatterSettings:map[string]interface {}{"line_ending":"lf"}}
[DEBUG ISSUE 97] collector=&yamlfmt.DoublestarCollector{Include:[]string{"./temp/**/*{yaml,yml}"}, Exclude:[]string{"**/x.yml"}}
[DEBUG ISSUE 97] entered doublestar collector
[DEBUG ISSUE 97] includedPaths=[]string{"temp/one/two/x.yml"}
[DEBUG ISSUE 97] excluded because of pattern="**/x.yml" absPath="/Users/ross/projects/google-yamlfmt/temp/one/two/x.yml"
[DEBUG ISSUE 97] no match pattern="**/x.yml" absPath="/Users/ross/projects/google-yamlfmt/temp/one/two/x.yml"
[DEBUG ISSUE 97] collect paths returned collectedPaths=[]string{}
[DEBUG ISSUE 97] analyze paths returned paths=[]string{}

This dummy example aside, my main issue was that I had a .yamlfmt like this:

# yamlfmt mangles helm charts and throws errors, 
# `helm lint` should be used for linting charts
exclude:
  - data/k8s/charts/**

and was running:

yamlfmt -dstar 'data/k8s/**/*.{yaml,yml}'

(truncated) logs:

[DEBUG ISSUE 97] c.Config=&command.Config{Extensions:[]string{"yaml", "yml"}, Include:[]string{"data/k8s/**/*.{yaml,yml}"}, Exclude:[]string{"data/k8s/charts/**/*.{yaml,yml}"}, RegexExclude:[]string(nil), Doublestar:true, LineEnding:"lf", FormatterConfig:(*command.FormatterConfig)(0x1400000c1f8)}
[DEBUG ISSUE 97] c.Config.FormatterConfig=&command.FormatterConfig{Type:"", FormatterSettings:map[string]interface {}{"line_ending":"lf"}}
[DEBUG ISSUE 97] collector=&yamlfmt.DoublestarCollector{Include:[]string{"data/k8s/**/*.{yaml,yml}"}, Exclude:[]string{"data/k8s/charts/**/*.{yaml,yml}"}}
[DEBUG ISSUE 97] entered doublestar collector
[DEBUG ISSUE 97] includedPaths=[]string{"data/k8s/bases/other/paths/example.yaml", <many other paths>, "data/k8s/charts/some-chart/Chart.yaml"}
[DEBUG ISSUE 97] no match pattern="data/k8s/charts/**/*.{yaml,yml}" absPath="/Users/ross/projects/core/data/k8s/charts/vendor/some-chart/templates/foo.yaml"
[DEBUG ISSUE 97] included because not excluded path="data/k8s/charts/vendor/some-chart/templates/foo.yaml"
encountered the following formatting errors:
data/k8s/charts/vendor/some-chart/templates/foo.yaml: yaml: did not find expected node content

This works fine with v0.8.0 and fails with many errors from files under data/k8s/charts in v0.9.0

@badouralix
Copy link
Contributor

I see, it seems the behavior changed when this diff was introduced in https://github.com/google/yamlfmt/pull/105/files#diff-64650b9066f9ed386546a3f7db1cc7c3a9bb4f422970d7506dd6b051b797f010

- match, err := doublestar.Match(filepath.Clean(pattern), path)
+ match, err := doublestar.PathMatch(filepath.Clean(pattern), absPath)

Basically data/k8s/charts/**/*.{yaml,yml} used to match the ( relative ) path data/k8s/charts/vendor/some-chart/templates/foo.yaml
But now we convert the path into the absolute path /Users/ross/projects/core/data/k8s/charts/vendor/some-chart/templates/foo.yaml
And the pattern does not match this absolute path

@rhbuf a quick fix for you would be to use this .yamlfmt instead

# yamlfmt mangles helm charts and throws errors, 
# `helm lint` should be used for linting charts
exclude:
- **/data/k8s/charts/**

@braydonk would you be able to clarify the need for an absolute path instead of the regular path ?
Is an exclude pattern not starting with / or **/ valid ? I guess it would make sense to accept it and assume the pattern is relative to directory containing the .yamlfmt or the current directory if using the --exclude cli flag ?

@braydonk
Copy link
Collaborator

braydonk commented Apr 11, 2023

Thanks for the help working through this @badouralix I have been sick and not looking at GitHub this weekend.

The change to absolute path was because previously absolute paths wouldn't match on every circumstance. If the collected path was like this:

data/k8s/charts/chart.yaml

And the exclude path was like this:

/Users/someone/data/charts/k8s/**/*.yaml

Then it would think the collected path is not a match for the exclusion pattern. The only way that made sense was to get the absolute path of the collected path. What I didn't realize is that I just inverted the problem.

This prompted me to take a look, and I realized that I have been skipping the Doublestar Path Collector test suite unintentionally for a long time. Just tried re-enabling those tests and they are all broken. I apologize for all the weird stuff I've introduced here trying to fix this without realizing what I did. I'm going to need to re-enable that test suite and then come up with a solution that actually works properly for this. Thank you everyone for your patience. Work has been busy, so I haven't been able to spend any work time on this recently. This will probably need to wait until I have an evening available to clean all this stuff up.

Side note, yes I really should have a -version option and debug logging. I'm going to come up with a way to set those up as well. That is along the lines of the cleanup I'm trying to spend my time on for the next little while.

braydonk added a commit to braydonk/yamlfmt that referenced this issue Apr 12, 2023
Doublestar tests have been disabled for quite a long time and I honestly
forget why they were. Regardless, they were missing some features to be
properly robust anyway. This PR re-enables the tests and adds two test
cases relevant to google#97 that will be skipped individually for now.
braydonk added a commit to braydonk/yamlfmt that referenced this issue Apr 12, 2023
Doublestar tests have been disabled for quite a long time and I honestly
forget why they were. Regardless, they were missing some features to be
properly robust anyway. This PR re-enables the tests and adds two test
cases relevant to google#97 that will be skipped individually for now.
braydonk added a commit that referenced this issue Apr 12, 2023
Doublestar tests have been disabled for quite a long time and I honestly
forget why they were. Regardless, they were missing some features to be
properly robust anyway. This PR re-enables the tests and adds two test
cases relevant to #97 that will be skipped individually for now.
@braydonk
Copy link
Collaborator

braydonk commented Apr 12, 2023

The PR I just merged re-enables the tests, and features a couple new test cases that demonstrate what I believe to be the root of the problem. If you mix relative and absolute paths with your include and exclude patterns, then doublestar.PathMatch will fail to match in either scenario. I'm trying to decide if there's a sane way to handle this strange case in a uniform way, or improving the doublestar matching documentation to feature some more detailed gotchas (that probably should happen anyway).

@esn89
Copy link
Author

esn89 commented Apr 12, 2023

@badouralix

Here is the debug log from that command:

go: downloading github.com/braydonk/yaml v0.7.0
go: downloading github.com/RageCage64/multilinediff v0.2.0
go: downloading github.com/bmatcuk/doublestar/v4 v4.6.0
[DEBUG ISSUE 97] c.Config=&command.Config{Extensions:[]string{"yaml", "yml"}, Include:[]string{"/Users/ev/Documents/Projects/supercool/.gitlab-ci.yml"}, Exclude:[]string{"/Users/ev/Documents/Projects/**/templates/**", "/Users/ev/Documents/Projects/**/.gitlab-ci.yml"}, RegexExclude:[]string(nil), Doublestar:true, LineEnding:"lf", FormatterConfig:(*command.FormatterConfig)(0xc0000101f8)}
[DEBUG ISSUE 97] c.Config.FormatterConfig=&command.FormatterConfig{Type:"basic", FormatterSettings:map[string]interface {}{"include_document_start":true, "indent":2, "line_ending":"lf"}}
[DEBUG ISSUE 97] collector=&yamlfmt.DoublestarCollector{Include:[]string{"/Users/ev/Documents/Projects/supercool/.gitlab-ci.yml"}, Exclude:[]string{"/Users/ev/Documents/Projects/**/templates/**", "/Users/ev/Documents/Projects/**/.gitlab-ci.yml"}}
[DEBUG ISSUE 97] entered doublestar collector
[DEBUG ISSUE 97] includedPaths=[]string{"/Users/ev/Documents/Projects/supercool/.gitlab-ci.yml"}
[DEBUG ISSUE 97] no match pattern="/Users/ev/Documents/Projects/**/templates/**" absPath="/Users/ev/Documents/Projects/supercool/.gitlab-ci.yml"
[DEBUG ISSUE 97] excluded because of pattern="/Users/ev/Documents/Projects/**/.gitlab-ci.yml" absPath="/Users/ev/Documents/Projects/supercool/.gitlab-ci.yml"
[DEBUG ISSUE 97] no match pattern="/Users/ev/Documents/Projects/**/.gitlab-ci.yml" absPath="/Users/ev/Documents/Projects/supercool/.gitlab-ci.yml"
[DEBUG ISSUE 97] collect paths returned collectedPaths=[]string{}
[DEBUG ISSUE 97] analyze paths returned paths=[]string{}

Here is the .yamlfmt:

doublestar: true
exclude:
  - "/Users/ev/Documents/Projects/**/templates/**"
  - "/Users/ev/Documents/Projects/**/.gitlab-ci.yml"
formatter:
  type: basic
  indent: 2
  include_document_start: true

So far, it looks okay. The gitlab-ci.yaml wasn't touched.

@braydonk
Copy link
Collaborator

braydonk commented Jun 7, 2023

I decided to make it clear in the docs that this only works when both paths are absolute or both paths are relative, and to suggest that relative paths be used in most circumstances. It is probably a solvable problem to make this work in cases where some paths are absolute and some are relative, however with the limited time I have for this project these days I don't think I'm going to be able to make time for it. 😞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants