YAML files produced by dump are not linter friendly.
Example dumped.yaml is attached.
require 'psych'
loaded = Psych.load_file('feature_flags.yaml')
#puts loaded
#puts Psych.methods
File.write 'dumped.yaml', Psych.dump(loaded)
$ yamllint dumped.yaml
feature_flags.yaml
4:3 error wrong indentation: expected 4 but found 2 (indentation)
5:81 error line too long (82 > 80 characters) (line-length)
12:81 error line too long (82 > 80 characters) (line-length)
19:81 error line too long (82 > 80 characters) (line-length)
26:81 error line too long (82 > 80 characters) (line-length)
33:81 error line too long (82 > 80 characters) (line-length)
34:23 error trailing spaces (trailing-spaces)
40:81 error line too long (82 > 80 characters) (line-length)
47:81 error line too long (82 > 80 characters) (line-length)
54:81 error line too long (87 > 80 characters) (line-length)
...
So how to produce linter friendly YAML with Psych?
yamlrb.tar.gz
YAML files produced by
dumpare not linter friendly.Example
dumped.yamlis attached.So how to produce linter friendly YAML with Psych?
yamlrb.tar.gz