Skip to content

Use Configurate or snakeyaml for yml parsing #2471

Description

@AuroraLS3

I would like to be able to..

Split from #1363

Not use a custom yml parser (Leads to bugs #2297)

Is your feature request related to a problem? Please describe.

The previous ticket #1363 had unrelated stuff about moving to configurate in it. It is below

TODO

  • Prepare for configurate
    • Extract interface from Config and ConfigNode, (keep implementation with classes LegacyConfig and LegacyConfigNode)
    • Extract interface from and rename ConfigReader and ConfigWriter to LegacyConfigReader and LegacyConfigWriter
  • Write configurate based Config implementation
    • Add configurate as a dependency, shadow and relocate it
    • Implement ConfigNode and Config interfaces with configurate
    • Move everything that extends LegacyConfig to use ConfigurateConfig
      • Optional: If it is easier, change the configs to use composition instead of inheritance
    • Implement ConfigReader and ConfigWriter and writer for configurate.
    • Implement a ConfigReader and ConfigWriter that pass the read/write call to appropriate implementation
      • eg: If ConfigurateConfigReader fails to read the yml (Because it is not valid yml), read with LegacyConfigReader so that the modifications mentioned above can be applied.
      • eg: If Writer is passed a LegacyConfig it is written with LegacyConfigWriter

Acceptance criteria

At the end of this following classes should exist:

  • Config (interface)
  • ConfigNode (interface)
  • ConfigWriter
  • ConfigReader
  • LegacyConfig
  • LegacyConfigNode
  • LegacyConfigWriter
  • LegacyConfigReader
  • ConfigurateConfig
  • ConfigurateConfigNode
  • ConfigurateConfigWriter
  • ConfigurateConfigReader
  • _____ConfigReader (the reader that calls other readers)
  • _____ConfigWriter (the writer that calls other writers)

Validations:

  • Plan can enable with an old config (I think there is an unit test for this)
  • Old config is transformed during enable
  • Transformed yml is valid yml
  • Config does not lose comments when using configurate
  • Plan can enable with a new config without using LegacyConfig

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status
      Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions