I have just finalized and release version 0.9.0 of my stevedore command line tool, to assist in handling Docker ignore files.
The most recent feature addition is the detection and use of a repository based configuration file.
The file should be named: .stevedore.json
and should reside in the root of the project/repository. The file can contain presets for most of the common command line arguments, so these will not have to be entered upon every invocation.
Example:
{
"$schema": "stevedore-config.schema.json",
"color": true,
"debug": false,
"excluded": false,
"fullpath": true,
"ignorefile": ".stevedoreignore",
"included": false,
"invertcolor": false,
"verbose": false
}
For example you could set the invertcolor
to true
and the red and green coloring would be inverted, if that was your preferences. Do note you only have to specify the parameters, which you do not want to type upon every invocation and that differs from the default.
It took some time to get the precedence of the command line flags over the configuration to work. But luckily the Go flag package, has a method: visit
(documentation), which allows for easy post-processing of all used flags.
I am not sure I will keep the configuration file in JSON format, since it is much more suitable for data, so I am evaluating YAML - but with schema handling, since that is what I am aiming for and why I chose JSON over YAML in the first place. There seem to be options to use schemas for YAML as well, but I will need to do some more research before making a decision - any pointers or suggestions would be most welcome.
Next up on the implementation plan, is a global configuration file, see issue #28.
Feedback and suggestions most welcome. Releases should be available for download for most platforms.
Or you can install using Go:
go install github.com/jonasbn/stevedore@v0.9.0