sindresorhus / atom-editorconfig

Helps developers maintain consistent coding styles between different editors
https://atom.io/packages/editorconfig
MIT License
812 stars 80 forks source link

indent_style is not working (showing auto even though I specify it) #172

Closed d3ming closed 7 years ago

d3ming commented 7 years ago

Here's my .editorconfig file:

# EditorConfig sets a style guide supported by most editors:
# Get plugins here: http://editorconfig.org/#download
root = true

[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.py]
indent_style = space
indent_size = 4

[Makefile]
indent_style = tab

[*.yaml, *.yml]
indent_style = space
indent_size = 2

As you can see, the indent_style is specified for different files. I'm currently editing a .yml file but it indents with tab even though it should be with space. When I check the state, I get this: http://screencast.com/t/TlpAFiOxE

docker-compose.override.yml
The editorconfig was applied successfully and the editor for this file should work as expected. If you face any unexpected behavior please report us the issue. ♥️

Active Configuration

Editorconfig-Property   Applied Setting
end_of_line \n
charset auto
indent_style    auto
indent_size/ tab_width  auto
insert_final_newline    true
trim_trailing_whitespace    true
max_line_length auto
(auto: atom-editorconfig is not influencing that behavior. A full description of the properties can be found on editorconfig.org.)

Note that indent_style is showing auto even though I specify what it should be in the editorconfig file. Please help! I looked through all the issue threads leading up to https://github.com/sindresorhus/atom-editorconfig/issues/89 and it doesn't seem like this should still be an issue.

florianb commented 7 years ago

Hi @d3ming,

thanks for reporting this issue.

I need a listing of your file/directory-structure to be able to help you seriously.

However, you could try setting the yaml-section like this:

[*.{yaml,yml}]
indent_style = space
indent_size = 2

I know there were some issues with the glob-patterns, unfortunately we're not parsing the editorconfig-files ourselves but rely on https://github.com/editorconfig/editorconfig-core-js

d3ming commented 7 years ago

Ah your suggestion for worked!

As for the directory structure, I was editing a the docker-compose.yml file in the root directory of a project that has the .editorconfig file that I pasted above.

florianb commented 7 years ago

Thank you very much for your response! 🎁

I am sorry that the globbing didn't work as expected. We will see if the future changes that. I will close this issue for now. If there is anything you'd like to add, feel free! ☕️