--
You received this message because you are subscribed to the Google Groups "EditorConfig" group.
To unsubscribe from this group and stop receiving emails from it, send an email to editorconfig...@googlegroups.com.
To post to this group, send email to editor...@googlegroups.com.
Visit this group at https://groups.google.com/group/editorconfig.
For more options, visit https://groups.google.com/d/optout.
Hi Trey,
Thanks for your response. I did some gap analysis and here are some of my findings:
Regarding the parser,
Currently, there is only “get_properties” function as the interface for editor-core-py which takes in “filepath” as argument and calls EditorConfigHandler class’ get_configurations method and returns the EditorConfig options just for the “filepath” specified as argument.
However, the behavior that will be easier for us to consume is to extract the all the section names and corresponding configurations from the ".editorconfig" like a normal parser for any file.
We can have a EditorConfigParser class that doesn’t require filepath to initialize and simply searches for “.editorconfig” file in the project directory and returns the parsed version if found. An example of the parsed result can look like :-
{
"*.in": {
"trim_trailing_whitespace": "false"
},
"*.md": {
"indent_style": "space",
"indent_size": "4"
}
}
The file https://github.com/editorconfig/editorconfig-core-py/blob/master/editorconfig/ini.py is complete parser in itself but doesn’t expose any function that can be called to return a python-object after parsing the sections of “.editorconfig” file. This is the reason I had to make slight modifications to existing ini.py to adapt to simple parser requirements (https://github.com/satwikkansal/coala-quickstart/blob/79/coala_quickstart/parsers/editorconfig_parser.py ). I think similar changes can be easily be chipped into official “editorconfig-py” and exposed as a method so that we can easily use the official library.
Regarding the Generator,
I’m sorry none of the coala member were able to have a conversation with you regarding this idea at this year’s PyCon. The primary objective of the generator is to develop a editorconfig-coafile interface that has methods to read any of the two and generate the other in case of absence. I’m trying to come up with an appropriate design for the generator. If you have any thoughts and ideas, please let me know.