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

Skip generated option #101

Closed
viktorvoltaire opened this issue Mar 29, 2023 · 4 comments · Fixed by #106
Closed

Skip generated option #101

viktorvoltaire opened this issue Mar 29, 2023 · 4 comments · Fixed by #106
Milestone

Comments

@viktorvoltaire
Copy link

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.

@braydonk
Copy link
Collaborator

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.

@braydonk braydonk added this to the Future Plans milestone Mar 29, 2023
@viktorvoltaire
Copy link
Author

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 👍

@braydonk
Copy link
Collaborator

braydonk commented Apr 2, 2023

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!

@viktorvoltaire
Copy link
Author

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!

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

Successfully merging a pull request may close this issue.

2 participants