Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Footer comments #356

Open
ljacqu opened this issue Aug 20, 2023 · 1 comment
Open

Footer comments #356

ljacqu opened this issue Aug 20, 2023 · 1 comment
Labels
good-first-issue Want to contribute? This label marks well-defined, [relatively] straightforward issues
Milestone

Comments

@ljacqu
Copy link
Member

ljacqu commented Aug 20, 2023

Footer comments were added in one of the forks: SkinsRestorer/ConfigMe@8281744#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 ljacqu added this to the 2.1.0 milestone Aug 21, 2023
@ljacqu ljacqu added the good-first-issue Want to contribute? This label marks well-defined, [relatively] straightforward issues label Aug 29, 2023
@ljacqu
Copy link
Member Author

ljacqu commented Oct 6, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good-first-issue Want to contribute? This label marks well-defined, [relatively] straightforward issues
Development

No branches or pull requests

1 participant