Hi Satwik,

  

I don't use coala myself but I sprinted on it briefly last year during PyCon
and it seems like a cool project.

  

Personally, I like the idea of having official parsers and official
EditorConfig file generators. Two thoughts on this:

  

  1. I see editorconfig-core-py as an official parser. Does it not meet your 
needs? If not, are there additions or changes we could make to the API of the 
project to make it easier to use as a Python library for parsing EditorConfig 
files?
  2. I don't think we should declare just one official EditorConfig parser 
library. We've struggled with this in the past and decided on implementing 
libraries that have identical CLI functionality in different languages (Java, 
Ruby, Python, C, etc.)
  3. It would be nice to have centralized tests for an official EditorConfig 
generator the same way we do for the parsers. I'm not sure if this is possible 
though because I don't know whether a command-line interface makes much sense 
for such a library.

  

Thanks for starting this discussion Satwik. If we decide it's a good idea, I'd
be happy to chat about it during the PyCon sprints if anyone from the coala
team plans to be there this year.

  

I'll let others chime in with their thoughts.

  
\--

Trey Hunner

Python & Django trainer

[Truthful Technology](http://truthful.technology)

[Weekly Python Chat](https://weeklypython.chat)

  
On Apr 28 2017, at 1:47 am, Satwik Kansal <[email protected]> wrote:  

> Hi,  
  
This email is on behalf of the community of coala, a Python-based static code
analysis tool.  
We’re trying to integrate a few features related to .editorconfig files into
coala. These features require us to parse and generate “.editorconfig” files.
We would like to collaborate with the editorconfig community to develop
standard python packages for parsing and generating .editorconfig files.  
  
For parsing, we found https://github.com/editorconfig/editorconfig-core-py but
it doesn’t perform simple parsing. Realizing the editorconfig format is
similar to “.ini” configuration file format, a prototype implementation of
“editorconfig” parser adapted from editorconfig-core-py that can be used for a
more general use by projects like coala is:  
https://github.com/satwikkansal/coala-
quickstart/blob/79/coala_quickstart/parsers/editorconfig_parser.py  
Similarly, it is possible to create “editorconfig” files programmatically
using ConfigParser’s capability of writing sections for config files.  
  
With official packages for parsing and creating “.editorconfig”, it would be
possible for other projects to develop something that utilizes the style
configurations in the “.editorconfig”, or to generate “.editorconfig” files
automatically based on some logic. Here’s how coala plans to use these
libraries:  
  
1\. Generating “.editorconfig”  file from the “.coafile” (coala’s
configuration file): This will allow coala  users to automatically generate
“.editorconfig" file, so that they are able to use the same style preferences
as provided by them in the coafile when working in editors that editorconfig
supports. Related issue: https://github.com/coala/coala/issues/4098 .  
2\. Use the style configurations from “.editorconfig” file: This information
can be directly used by coala as settings for the static code analysis
routines and perform a more tailored analysis. Related issue:
https://github.com/coala/coala-quickstart/issues/79  
  
Both the above features will help to closely integrate “.coafile” and
“.editorconfig”. The editor plugins will be able to generate the other if one
of them is absent. Or if both of the “coafile” and “.editorconfig” files are
present, the consistency of style preferences could be checked and a warning
may be raised to the users if they go out of sync. This would also allow coala
to seamlessly support “.editorconfig” files.  
  
It’d be really nice to have official libraries for generator and parser so
that the projects utilizing editorconfig don’t have to maintain their own
custom parser and keep up with upstream changes now and then.  
  
coala’s community will be more than happy to collaborate in implementing
libraries for editorconfig. We would like to hear your views and opinions on
this. If you guys are interested in this project, we can further discuss it at
our gitter channel: https://gitter.im/coala/coala or in this thread as per
your convenience.  
  
Thanks and Regards,  
The coala community  
  

>

> \--  
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 [[email protected]](mailto:editorconfig+unsub
[email protected]).  
To post to this group, send email to
[[email protected]](mailto:[email protected]).  
Visit this group at <https://groups.google.com/group/editorconfig>.  
For more options, visit <https://groups.google.com/d/optout>.  

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/editorconfig.
For more options, visit https://groups.google.com/d/optout.

Reply via email to