google / yamlfmt

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

feat: adding a feature to load config file located other than workind directory

daisuke834 opened this issue · comments

I am very interested in this tool.

As written in the README.md, .yamlfmt configuration file is automatically loaded from the working directory, but it doesn't seem to have a feature to optionally specify the path of the config file to be loaded. For example, other tool such as yamllint has an option -c like this:

yamllint -c path/to/yamllint.yaml foo.yaml

https://github.com/adrienverge/yamllint#usage

yamlfmt seems to have the following three options only at this moment.

$ ./yamlfmt --help
Usage of ./yamlfmt:
  -dry
    	Perform a dry run; show the output of a formatting
    	operation without performing it.
  -in
    	Format yaml read from stdin and output to stdout
  -lint
    	Check if there are any differences between
    	source yaml and formatted yaml.

I know my sudden post and request might be impolite, but may I ask a favor of you to add a feature to optionally specify the path of config file to be loaded?

Thank you for the suggestion! This is actually something I meant to do right from the beginning, but I forgot to and it slipped my mind. Should be trivial. I'll include it in v0.3.0. Thank you for your interest and patience!

@braydonk
Thank you so much for your very quick action!!!