Comments (8)
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.
@jayvdb can you please explain the issue in detail like you have done for difficulty/medium issues?
from coala-quickstart.
@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.
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.
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.
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.
Imo this one is not difficulty/low
, at least difficulty/medium
.
from coala-quickstart.
Done with 5462996
from coala-quickstart.
Related Issues (20)
- Node initialiser includes dead code HOT 1
- initialize_project_data includes dead code HOT 1
- function green_mode unnecessary delayed import of check_filename_prefix_postfix HOT 10
- UtilitiesTest.py test method test_search_for_orig contains dead code HOT 2
- test_bear_test_fun_2 contains unused test_unified_results HOT 2
- TestUtilities.py bear_test_module unused variable mocked HOT 1
- .travis.yml: Cache ntlk data
- add .coafile.green to .gitignore HOT 1
- facilitate deletion of coafile.green on running pytest HOT 3
- Investigate: how to use the nextgen-core for more reliable and easier processing of bears HOT 1
- coala-ci failing because of old version of a bear
- green_modeTest.py: Unused import AllKindsOfSettingsDependentBear HOT 3
- Unable to install for Python 3.7 HOT 2
- Use coala & coala-bears master HOT 2
- Spelling mistake taraget HOT 5
- Spelling mistake caputred HOT 1
- Add .editorconfig to moban sync HOT 1
- green_mode.py: Incomplete branch coverage on python3.6 HOT 2
- Make coala-quickstart generate configuration files in TOML
- spelling of command is incorrect in Installation section. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coala-quickstart.