Footer comments
Footer comments were added in one of the forks: https://github.com/SkinsRestorer/ConfigMe/commit/82817446380dd68fb71fc9aa90ca7b38c2183839#diff-3ffbfe7dc32739c0f967addeb0cc4cad2edb3bbe196d94d14f43439a08ce6e1f We can easily add this to ConfigMe.
To do
- Extend
CommentsConfigurationto be able to store footer comments- See note below for an idea so that a separate List isn't required everywhere
- Extend
ConfigurationData(Impl)to hold footer comments - Add support for footer comments in
YamlFileResource(hint: Node#endComments) - Add unit tests
- Ensure that footer comments are added for a normal configuration file with multiple properties
- Ensure that footer comments are added for a config that has only one property at root path (
"")
Notes
- So that it's not needed to have a separate
Listjust for the footer comments everywhere, one idea is to add aStringconstant (maybe inConfigurationData, orCommentsConfiguration?) with a dummy string that is unlikely to be a property path, and to use that as key for footers. For example,..FOOTERis not a valid path and is guaranteed not to coïncide with a property path. Add a default methodaddFooterCommentstoCommentsConfigurationso that a user doesn't need to know about the constant. - Introduce also a method
addHeaderCommentsthat registers them to the root path ("") for ease of us
Interesting test: if there's only one optional property, are header/footer comments added if the property is empty? Property with root path ("") or something else
Hi, I’d like to work on this footer comments feature. Would it be okay to pick this up?
hi @oolong-enterprises, absolutely, thanks for the interest :smile: If you need any pointers, feel free to ask.