google / yamlfmt

An extensible command line tool or library to format yaml files.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

yamlfmt does not respect `excldue`

chenrui333 opened this issue Β· comments

πŸ‘‹ I am trying to introduce yamlfmt into atlantis project, but whenever I run with the following config file

exclude:
  - .circleci/config.yml
  - .github/**

the yamlfmt still tries to fmt the .github/workflow/*.yml files, did I miss anything? Thanks!

relates to runatlantis/atlantis#4123

Hi @chenrui333 thanks for opening an issue.

Is that your full config? To use ** you need to enable the configuration doublestar: true. Once I do that, what you have works for me.

doublestar: true
include:
  - "./**/*.{yaml,yml}"
exclude:
  - ".github/**"

Is that your full config? To use ** you need to enable the configuration doublestar: true. Once I do that, what you have works for me.

any documentation for this? (I was borrowing it from https://github.com/tinkerbell/tink/blob/main/.yamlfmt)

Looks like the file you linked is for v0.6.0, which is before the default path collection strategy changed from doublestar globs to more basic full-directory inclusion. You can see the distinction in the paths.md documentation.

Cool, thanks for the docs! Appreciate it! :)