Giter Club home page Giter Club logo

Comments (8)

jayvdb avatar jayvdb commented on May 27, 2024 1

I suggest talking with that project, asking them if they are interested in more methods being added, to achieve what you need. (sounds like you have code which could be dropped in easily.) Then everyone benefits; most of all, coala benefits in having someone else maintaining the functionality we rely on.

from coala-quickstart.

jack17529 avatar jack17529 commented on May 27, 2024

@jayvdb can you please explain the issue in detail like you have done for difficulty/medium issues?

from coala-quickstart.

satwikkansal avatar satwikkansal commented on May 27, 2024

@jayvdb I've created a custom .editorconfig parser which is able to extract the properties and values. Just wanted to consult you for the next steps :)
Taking a look at the EditorConfig properties wiki, I realized that there is mismatch in the "names of the properties in the EditorConfig files" and the "names of settings of bears that can utilize that property". Example, in ".editorconfig", to define a preferred quotation style, we write quote_type = single but for the QuotesBear, we write preferred_quotation = ' in the ".coafile".

One possible approach is:
We can first define a meta dictionary like

editorconfig_meta = {
	"property_name": [list, of, bears, affected, by, the, property]
}

and because every bear may use this setting differently, we'd have to write mapping logic to map the "property and its value" to the "bear's setting and its value". Example, the values of the property max_line_length in .editorconfig can either be a positive integer or just the string "off". So the mapping logic corresponding to the max_line_length property will have to take care of "off" values because our LineLengthBear doesn't understand what "off" means.

The problem with this approach is we will have to write a lot of mapping functions corresponding to combinations of "every property in .editorconfig and every bear that can utilize that property" and we'll have to maintain them indefinitely. One idea to reduce the mapping maybe to follow the ".editorconfig" like property styles in our bears' settings as well (like replacing preferred_quotation with quote_type in QuoteBear and every other bear with similar setting).

from coala-quickstart.

jayvdb avatar jayvdb commented on May 27, 2024

because every bear may use this setting differently

That may be the case now, but ... we are standardising the names of settings, irrespective of the bears.
i.e. the bears must use the same name for the same concept, and we are fixing discrepancies where they exist.
So, use the most common setting only, and create bugs for any discrepancy that you notice.

from coala-quickstart.

jayvdb avatar jayvdb commented on May 27, 2024

Also, please analyse https://github.com/editorconfig/editorconfig-core-py , to see if it is not usable instead of a custom parser? (and custom writer for coala/coala#4098)

from coala-quickstart.

satwikkansal avatar satwikkansal commented on May 27, 2024

I did analyze https://github.com/editorconfig/editorconfig-core-py , actually the way it works is not suitable for this issue.
It has only get_properties method as the interface which takes in filename/file globs as argument and returns the configurations of the sections in ".editorconfig" that match the argument passed.
However, I think the behavior we want is to extract the all the sections and corresponding configurations from the ".editorconfig". My implementation of the custom parser is derived from editorconfig-core-py's parser adapted according to our use case.

from coala-quickstart.

Makman2 avatar Makman2 commented on May 27, 2024

Imo this one is not difficulty/low, at least difficulty/medium.

from coala-quickstart.

satwikkansal avatar satwikkansal commented on May 27, 2024

Done with 5462996

from coala-quickstart.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.