google / yamlfmt

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Skip generated option

viktorvoltaire opened this issue · comments

Hi,

What do you think about adding an option to skip generated yaml files, meaning if they have a generated by comment? I think this would be superior rather than having to manually exclude these files.

Thanks for the suggestion! I think matching on some specific generated by comment would be too perscriptive, since there's an endless number of tools that could be generating YAML.

What about a regex content exclusion? Like if the contents of any particular file match a regex then it's excluded. I think that could accomplish the same goal.

Thanks for the suggestion! I think matching on some specific generated by comment would be too perscriptive, since there's an endless number of tools that could be generating YAML.

What about a regex content exclusion? Like if the contents of any particular file match a regex then it's excluded. I think that could accomplish the same goal.

That sounds like a good middle ground 👍

This will be in the release today. I also added a separate option at the same time that I thought about when I started working on this issue, which is have a special metadata string that yamlfmt will recognize. Adding this to a yaml file:

# !yamlfmt!:ignore

Will also cause yamlfmt to exclude the file. Hopefully one of these methods will help your use case!

This will be in the release today. I also added a separate option at the same time that I thought about when I started working on this issue, which is have a special metadata string that yamlfmt will recognize. Adding this to a yaml file:

# !yamlfmt!:ignore

Will also cause yamlfmt to exclude the file. Hopefully one of these methods will help your use case!

Amazing, thank you for the swift response!