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

Config read, but not applied #170

Closed MichaelJCole closed 7 years ago

MichaelJCole commented 7 years ago

Hi, trim_trailing_whitespace isn't being applied to my config and it is making me crazy-go-nuts.

Editorconfig: show config:

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    auto
max_line_length auto
(auto: atom-editorconfig is not influencing that behavior. A full description of the properties can be found on editorconfig.org.)

/home/michael/scm/project/app/server/platform/updateReportsOnStartup.js

Involved .editorconfig-files

# EditorConfig is awesome: http://EditorConfig.org

# Howto with your editor:
#   Sublime: https://github.com/sindresorhus/editorconfig-sublime

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[**]
end_of_line = lf
insert_final_newline = true

# Standard at: https://github.com/felixge/node-style-guide
[**.js, **.json]
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2
max_line_length = 80
quote_type = single
curly_bracket_next_line = false
spaces_around_operators = true
space_after_control_statements = true
space_after_anonymous_functions = false
spaces_in_brackets = false

# https://github.com/jedmao/codepainter
[node_modules/**.js]
codepaint = false

# No Standard.  Please document a standard if different from .js
[**.yml, **.html, **.css]
trim_trailing_whitespace = true
indent_style = space
indent_size = 2

# No standard.  Please document a standard if different from .js
[**.md]
indent_style = space

# Standard at:
[**.py]
indent_style = space
indent_size = 4

# Standard at:
[Makefile]
indent_style = tab
indent_size = 8

Directory structure

I'm using linux.  You could too :-)

file from status above: app/server/platform/updateReportsOnStartup.js

$ find | grep .editorconfig 
./app/node_modules/autoprefixer/node_modules/num2fraction/.editorconfig
./app/node_modules/autoprefixer/node_modules/caniuse-db/.editorconfig
./app/node_modules/webshot/node_modules/phantomjs-prebuilt/node_modules/request-progress/.editorconfig
./app/node_modules/webshot/node_modules/cross-spawn/.editorconfig
./.editorconfig

Installed packages

$ apm list             
Built-in Atom Packages (88)
├── about@1.5.3
├── archive-view@0.61.1
├── atom-dark-syntax@0.27.0
├── atom-dark-ui@0.52.0
├── atom-grammar-test@0.6.0
├── atom-light-syntax@0.28.0
├── atom-light-ui@0.44.0
├── autocomplete-atom-api@0.10.0
├── autocomplete-css@0.11.2
├── autocomplete-html@0.7.2
├── autocomplete-plus@2.31.1
├── autocomplete-snippets@1.11.0
├── autoflow@0.27.0
├── autosave@0.23.1
├── background-tips@0.26.1
├── base16-tomorrow-dark-theme@1.1.0
├── base16-tomorrow-light-theme@1.1.1
├── bookmarks@0.41.0
├── bracket-matcher@0.82.1
├── command-palette@0.38.0
├── deprecation-cop@0.54.1
├── dev-live-reload@0.47.0
├── encoding-selector@0.22.0
├── find-and-replace@0.201.0
├── fuzzy-finder@1.3.0
├── git-diff@1.1.0
├── go-to-line@0.31.0
├── grammar-selector@0.48.1
├── image-view@0.58.2
├── incompatible-packages@0.26.1
├── keybinding-resolver@0.35.0
├── language-c@0.52.1
├── language-clojure@0.21.0
├── language-coffee-script@0.47.2
├── language-csharp@0.12.1
├── language-css@0.37.1
├── language-gfm@0.88.0
├── language-git@0.15.0
├── language-go@0.42.1
├── language-html@0.45.1
├── language-hyperlink@0.16.0
├── language-java@0.23.0
├── language-javascript@0.119.0
├── language-json@0.18.2
├── language-less@0.29.5
├── language-make@0.22.2
├── language-mustache@0.13.0
├── language-objective-c@0.15.1
├── language-perl@0.35.0
├── language-php@0.37.2
├── language-property-list@0.8.0
├── language-python@0.45.0
├── language-ruby@0.69.0
├── language-ruby-on-rails@0.25.0
├── language-sass@0.56.0
├── language-shellscript@0.22.4
├── language-source@0.9.0
├── language-sql@0.23.0
├── language-text@0.7.1
├── language-todo@0.28.0
├── language-toml@0.18.0
├── language-xml@0.34.9
├── language-yaml@0.26.0
├── line-ending-selector@0.5.0
├── link@0.31.1
├── markdown-preview@0.158.0
├── notifications@0.65.0
├── one-dark-syntax@1.3.0
├── one-dark-ui@1.5.0
├── one-light-syntax@1.3.0
├── one-light-ui@1.5.0
├── open-on-github@1.2.0
├── package-generator@1.0.0
├── settings-view@0.242.2
├── snippets@1.0.2
├── solarized-dark-syntax@1.0.2
├── solarized-light-syntax@1.0.2
├── spell-check@0.67.1
├── status-bar@1.4.1
├── styleguide@0.47.0
├── symbols-view@0.113.0
├── tabs@0.100.2
├── timecop@0.33.2
├── tree-view@0.208.2
├── update-package-dependencies@0.10.0
├── welcome@0.34.0
├── whitespace@0.33.0
└── wrap-guide@0.38.1

Community Packages (19) /home/michael/.atom/packages
├── atom-jade@0.3.0
├── docblockr@0.9.1
├── editorconfig@2.0.5
├── file-icons@1.7.25
├── highlight-column@0.5.1
├── highlight-selected@0.11.2
├── linter@1.11.18
├── linter-csslint@1.3.3
├── linter-handlebars@2.3.4
├── linter-jade@0.3.2
├── linter-jshint@3.0.1
├── linter-jsonlint@1.3.0
├── linter-less@2.6.0
├── merge-conflicts@1.4.4
├── minimap@4.25.7
├── minimap-highlight-selected@4.4.0
├── multi-cursor@2.1.5
├── seti-syntax@1.0.1
└── seti-ui@1.3.2

└── (empty)

config.cson

"*":
  core:
    autoHideMenuBar: true
    disabledPackages: [
      "whitespace"
    ]
  ...
MichaelJCole commented 7 years ago

Fiddling with it, I changed this:

[**.js, **.json]

to this and it worked:

[**.{js,json}]

The first version was an old syntax ported from Sublime.

florianb commented 7 years ago

Thank you for reporting this @MichaelJCole! 💝

This is 2nd issue reporting difficulties with the glob-syntax in a short time. I will keep this in mind hopefully improving this soon.