pyhocon icon indicating copy to clipboard operation
pyhocon copied to clipboard

to_hocon is so strange

Open therb1 opened this issue 6 years ago • 1 comments

Hello contributors and maintainers of this project. I was a little surprised by this implementation of the "to_hocon" function in "pyhocon/pyhocon/converter.py". I assumed that this function should determine the format of the data transmitted to the input and transfer it to HOCON. Could you explain the meaning of this function? And do you plan to do the translation function to HOCON from other formats like yaml, jsonm properties?

def to_hocon(cls, config, compact=False, indent=2, level=0):
        """Convert HOCON input into a HOCON output

therb1 avatar Sep 07 '18 13:09 therb1

Hi @therb1. This function is part of a class that converts hocon configs to a pretty formatted string. The class HOCONConverter should probably be renamed.

I like your idea to create a generic converter to and from json, yaml, properties and have a separate class that could format HOCON configs.

darthbear avatar Sep 07 '18 14:09 darthbear