Releases: google/yamlfmt
v0.6.0
First release in a while! I've been very busy this past month and was also sick for a bit. Not a ton going on this release, but there are some folks waiting for the minor fixes and one feature, so I figured no reason to delay the release.
Features
- Disallow yaml anchors and aliases
- New basic formatter configuration option
disallow_anchors
will forcefully reject anchors if you don't want them in your yaml files
- New basic formatter configuration option
Fixes
- Fixed a bug where
emoji_support
would eat any\
escape character - Fixed misuse of
path
package when should have been usingfilepath
package for cross-platform compatibility - Fixed issue where the tool would try to format a directory if it was picked up the include path
Contributors
v0.5.0
There was a bug in v0.4.0 caused by my oversight that I previously relied on empty string to represent no diffs. With the more robust reporter this was no longer true. I pulled in an update to the package that provides a diff count from the Diff
function and used that instead. While fixing that, I realized that the line separator for the multilinediff also assumed lf
line endings, which was basically a bug since the beginning. I fixed it with a rearchitecture that allowed for line_ending
to be a global setting. There is a chance I'll decide to adjust this again in the future, but in my current architecture that was the only way to make it work (other than autodetecting the line endings based on OS, but OS does not always imply line endings since there's lots of LF line ending folks on Windows).
It also made sense while doing this to adjust the yamlfmt.Factory
interface to simply be one function NewFormatter
, and make it so that function handles the case where the passed config is nil
.
Changelog
v0.4.0
This release is smaller than the last few. I wanted to get a release out before I go on leave for a bit.
Changes
emoji_support
This is a combination of a fix and a feature; the yaml.v3
library does not properly parse emojis because it cannot properly print 4-byte UTF-8 characters. Hopefully that gets fixed soon, and #41 is open to track that when it happens. While this would be sensible to make a default behaviour, I've opted to default to false
because it is a hack around a shortcoming of the upstream library.
retain_line_breaks
When this is enabled, yamlfmt will keep line breaks instead of deleting them. Similar to emoji_support
, I would have liked to make this default but because it's a hack around a shortcoming of the library I'm defaulting it to false
as well.
Functional Features architecture
This is an improvement to the API of the Basic Formatter, and features improvements to the base yamlfmt package as well. Previously, there were lots of special conditions tacked on before and after formatting in the Format
function of the Basic Formatter, and it was becoming increasingly tangled when the needs of the function expanded. This improves the extensibility of the formatter, which allows for "features" to be created and added to be run as hooks before and after yaml formatting. Future formatters that I write in this package will use it. This marks an improvement to folks forking this tool and adding their own functionality in, provides a nicer basis for folks interested in writing their own formatters, and should hopefully make future contribution a lot more straightforward.
Diff improvement
I've made another improvement to the diff readability. The diff now shows side by side, making it far more easy to read. It still needs some more work, however I've separated that work into a new package that I will from here on incrementally improve in my spare time.
stdout output is more convenient
I had used fmt.Println
to output to stdout in previous versions. This caused a problem for folks using yamlfmt as an editor integration, since yamlfmt already appends a newline to the formatted yaml. This release swapped to fmt.Print
instead.
If you have any problems or suggestions, feel free to make an issue!
Contributors
Thanks to @longkai for the retaining line break feature and the fix to stdout output.
Changelog
- d9d4189 chore: don't append new line at the end and keep the content as it is (#45)
- f3eff05 engine: switched to multilinediff package (#47)
- e05c99f fix #27 retain line break (#42)
- 9fffda5 fix: line break format issue after refactor code (#44)
- d9e8674 hotfix: add utf-8 parsint for emoji_support (#40)
- 6da562a yamlfmt: added and implemented functional features (#43)
v0.3.0
Features
- Can now operate in
stdin
mode with the Unix pattern of-
or/dev/stdin
arguments - Pass a custom config from another path using the
-conf
flag
Improvements/Fixes
- Works with CRLF
- Updated help message
Fixes
Changelog
v0.2.0
The big features of this release are:
- Multi-document file support
- Files with multiple documents separated by
---
are now supported and fully formatted
- Files with multiple documents separated by
include_document_start
option added- The default formatting behaviour doesn't include the
---
at the start of the document, this flag will ensure it's added
- The default formatting behaviour doesn't include the
stdin
operation mode- With the
-in
flag, the tool will read fromstdin
allowing for piping data through|
in the CLI
- With the
- Diff readability improved
- The diff readability is improved, still not as good as it will be eventually but this is a fine bandaid fix
One bug was fixed:
- Multiple paths in
exclude
no longer causes every single file to be found
Changelog
v0.1.0
Changelog
- c0bc122 Add missing license header
- 7b4f2d5 Add support for paths as command line args
- b15b9d8 Add usage documentation to README, fixed bugs found while writing
- 6b0aa78 Added missing license header
- 7451d46 Clean up unimportant test yaml files
- 7c28387 Delete test config file
- 69bd749 Formatting and linting all files working
- 479b4df Initial commit, WIP
- c5e9087 Restructured project for easier extensibility
- 39ddc57 Update to yaml.v3 and use yaml.Node (#4)
- 07d5e88 delete unnecessary 'return err' (#1)
- 36136ab fill in empty default config fields