Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow normal whitespace when reading EditorConfig settings file. #161

Closed
bfinney-thoughtworks opened this issue May 6, 2018 · 6 comments

Comments

@bfinney-thoughtworks
Copy link

bfinney-thoughtworks commented May 6, 2018

Text files can contain various normal whitespace (line breaks, horizontal space, vertical space, etc.) and remain compatible with the EditorConfig file format.

Here is an example file (rename to .editorconfig):

example-editorconfig.txt

That file, named as .editorconfig, works correctly with most EditorConfig libraries, but fails with ‘editorconfig-emacs’:

Error (editorconfig): Error while reading config file: /Users/bfinney/Projects/ECMAScript/JavaScript30/devel/.editorconfig:29:
    
.  Styles will not be applied.

For reference, the EditorConfig file format details documentation says the format is based on Python's configparser format. Using Python, the same file parses correctly:

>>> import configparser
>>> parser = configparser.SafeConfigParser()
>>> parser.read('.editorconfig')
['…/.editorconfig']
>>> parser.get('*', 'indent_size')
'4'

Probably the correct way to resolve this is to allow any Unicode whitespace character (those with the WSpace=Y property) when reading the settings file.

10sr added a commit that referenced this issue May 7, 2018
Currently core-handle fails to parse files that contain whitespaces
like line breaks, horizontal space, vertical space, etc.

#161
10sr added a commit that referenced this issue May 7, 2018
Currently core-handle fails to parse files that contain whitespaces
like line breaks, horizontal space, vertical space, etc.

#161
10sr added a commit that referenced this issue May 7, 2018
Currently core-handle fails to parse files that contain whitespaces
like line breaks, horizontal space, vertical space, etc.

#161
10sr added a commit that referenced this issue May 8, 2018
Currently core-handle fails to parse files that contain whitespaces
like line breaks, horizontal space, vertical space, etc.

#161
@10sr 10sr closed this as completed in #162 May 8, 2018
10sr added a commit that referenced this issue May 8, 2018
Allow normal whitespace when reading EditorConfig settings file

Currently core-handle fails to parse files that contain whitespaces like line breaks, horizontal space, vertical space, etc.

Fixes #161
@10sr
Copy link
Member

10sr commented May 8, 2018

Thanks for reporting!
It should be fixed now, try new version 🙏

@bfinney-thoughtworks
Copy link
Author

bfinney-thoughtworks commented May 8, 2018 via email

@jgkamat
Copy link
Contributor

jgkamat commented May 8, 2018

If you pull from melpa you should see an update in the next couple of hours. If you pull from melpa stable you'll need to wait for the next stable release...

@bfinney-thoughtworks
Copy link
Author

If you pull from melpa stable you'll need to wait for the next stable release

Thanks. What needs to be done before a new stable release of editorconfig-emacs then?

@jgkamat
Copy link
Contributor

jgkamat commented Jun 19, 2018 via email

@10sr
Copy link
Member

10sr commented Jun 19, 2018

I did not notice we have not had a release recently XP
I just published v0.7.12, which will be able to get from melpa stable shortly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants