ConfigMe icon indicating copy to clipboard operation
ConfigMe copied to clipboard

Footer comments

Open ljacqu opened this issue 2 years ago • 1 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 CommentsConfiguration to 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 List just for the footer comments everywhere, one idea is to add a String constant (maybe in ConfigurationData, or CommentsConfiguration?) with a dummy string that is unlikely to be a property path, and to use that as key for footers. For example, ..FOOTER is not a valid path and is guaranteed not to coïncide with a property path. Add a default method addFooterComments to CommentsConfiguration so that a user doesn't need to know about the constant.
  • Introduce also a method addHeaderComments that registers them to the root path ("") for ease of us

ljacqu avatar Aug 20 '23 17:08 ljacqu

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

ljacqu avatar Oct 06 '24 10:10 ljacqu

Hi, I’d like to work on this footer comments feature. Would it be okay to pick this up?

oolong-enterprises avatar Nov 06 '25 02:11 oolong-enterprises

hi @oolong-enterprises, absolutely, thanks for the interest :smile: If you need any pointers, feel free to ask.

ljacqu avatar Nov 06 '25 16:11 ljacqu