Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

trim_trailing_whitespace no longer applying #216

Closed
JourneyOver opened this issue Mar 28, 2018 · 13 comments
Closed

trim_trailing_whitespace no longer applying #216

JourneyOver opened this issue Mar 28, 2018 · 13 comments
Labels
bug 💵 Funded on Issuehunt This issue has been funded on Issuehunt untested

Comments

@JourneyOver
Copy link

JourneyOver commented Mar 28, 2018

Issuehunt badges

Thank you very much for contributing! ❤️ Leave us any feedback, idea or issue -- we are trying hard to improve atom-editorconfig!

Involved .editorconfig-files

# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

[*.svg]
insert_final_newline = false

Directory structure

.editorconfig is in the root of my project, no other .editorconfig files

Installed packages

Built-in Atom Packages (92)
├── atom-dark-syntax@0.29.0
├── atom-dark-ui@0.53.1
├── atom-light-syntax@0.29.0
├── atom-light-ui@0.46.1
├── base16-tomorrow-dark-theme@1.5.0
├── base16-tomorrow-light-theme@1.5.0
├── one-dark-ui@1.10.10
├── one-light-ui@1.10.10
├── one-dark-syntax@1.8.2
├── one-light-syntax@1.8.2
├── solarized-dark-syntax@1.1.4
├── solarized-light-syntax@1.1.4
├── about@1.8.0
├── archive-view@0.64.2
├── autocomplete-atom-api@0.10.7
├── autocomplete-css@0.17.5
├── autocomplete-html@0.8.4
├── autocomplete-plus@2.40.2
├── autocomplete-snippets@1.12.0
├── autoflow@0.29.3
├── autosave@0.24.6
├── background-tips@0.27.1
├── bookmarks@0.45.1
├── bracket-matcher@0.89.1
├── command-palette@0.43.5
├── dalek@0.2.1
├── deprecation-cop@0.56.9
├── dev-live-reload@0.48.1
├── encoding-selector@0.23.8
├── exception-reporting@0.43.1
├── find-and-replace@0.215.5
├── fuzzy-finder@1.7.5
├── github@0.10.3
├── git-diff@1.3.9
├── go-to-line@0.33.0
├── grammar-selector@0.49.9
├── image-view@0.62.4
├── incompatible-packages@0.27.3
├── keybinding-resolver@0.38.1
├── line-ending-selector@0.7.5
├── link@0.31.4
├── markdown-preview@0.159.20
├── metrics@1.2.6
├── notifications@0.70.2
├── open-on-github@1.3.1
├── package-generator@1.3.0
├── settings-view@0.254.1
├── snippets@1.3.1
├── spell-check@0.72.7 (disabled)
├── status-bar@1.8.15
├── styleguide@0.49.10
├── symbols-view@0.118.2
├── tabs@0.109.1
├── timecop@0.36.2
├── tree-view@0.221.3
├── update-package-dependencies@0.13.1
├── welcome@0.36.6
├── whitespace@0.37.5 (disabled)
├── wrap-guide@0.40.3
├── language-c@0.59.2
├── language-clojure@0.22.7
├── language-coffee-script@0.49.3
├── language-csharp@1.0.1
├── language-css@0.42.10
├── language-gfm@0.90.3 (disabled)
├── language-git@0.19.1
├── language-go@0.45.2
├── language-html@0.49.0
├── language-hyperlink@0.16.3
├── language-java@0.28.0
├── language-javascript@0.128.3
├── language-json@0.19.1
├── language-less@0.34.2
├── language-make@0.22.3
├── language-mustache@0.14.5
├── language-objective-c@0.15.1
├── language-perl@0.38.1
├── language-php@0.43.1
├── language-property-list@0.9.1
├── language-python@0.49.2
├── language-ruby@0.71.4
├── language-ruby-on-rails@0.25.3
├── language-sass@0.61.4
├── language-shellscript@0.26.1
├── language-source@0.9.0
├── language-sql@0.25.10
├── language-text@0.7.3
├── language-todo@0.29.4
├── language-toml@0.18.2
├── language-typescript@0.3.2
├── language-xml@0.35.2
└── language-yaml@0.31.2

Community Packages (63) C:\Users\JourneyOver\.atom\packages
├── aligner@1.2.4
├── aligner-javascript@1.3.0
├── ask-stack@2.2.0
├── atom-alignment@0.13.0
├── atom-beautify@0.32.2
├── atom-css-comb@3.3.1
├── atom-discord@1.5.1
├── atom-ide-ui@0.9.4 (disabled)
├── autoclose-html@0.23.0
├── batman-syntax@1.1.0
├── busy@0.7.0
├── busy-signal@1.4.3
├── convert-file-encoding@0.1.0
├── copy-path@0.5.1
├── editorconfig@2.2.2
├── file-icons@2.1.18
├── highlight-selected@0.13.1
├── ide-css@0.3.0 (disabled)
├── ide-python@0.9.1 (disabled)
├── intentions@1.1.5
├── language-autohotkey2@1.0.1
├── language-batch@0.4.0
├── language-groovy@0.7.0
├── language-lua@0.9.11
├── language-markdown@0.25.1
├── language-powershell@4.0.0
├── line-ending-converter@1.3.2
├── linter@2.2.0 (disabled)
├── linter-alex@4.0.0 (disabled)
├── linter-coffeelint@1.3.1 (disabled)
├── linter-csslint@2.0.0 (disabled)
├── linter-jshint@3.1.6 (disabled)
├── linter-proselint@3.3.0 (disabled)
├── linter-remark@5.1.0 (disabled)
├── linter-ruby@1.2.6 (disabled)
├── linter-shellcheck@1.4.6 (disabled)
├── linter-stylelint@4.2.0 (disabled)
├── linter-ui-default@1.7.1 (disabled)
├── markdown-lists@0.0.2
├── markdown-table-formatter@2.9.2
├── merge-conflicts@1.4.5
├── minimap@4.29.8
├── minimap-find-and-replace@4.5.2
├── minimap-git-diff@4.3.1
├── minimap-highlight-selected@4.6.1
├── minimap-linter@2.1.3 (disabled)
├── monokai-slate2@0.7.1
├── newton-dark-syntax@1.1.9
├── newton-dark-ui@1.1.3
├── pdf-view@0.67.0
├── pigments@0.40.2
├── platformio-ide-terminal@2.8.1 (disabled)
├── pretty-json@2.0.0
├── project-manager@3.3.5
├── regex-railroad-diagram@0.19.4
├── seti-syntax@1.1.3
├── seti-ui@1.10.0
├── split-diff@1.5.2
├── sync-settings@0.8.6
├── table-editor@0.2.2
├── tree-view-copy-relative-path@1.2.0
├── wakatime@7.0.4
└── wordcount@2.10.4

Notes

It doesn't seem to matter the contents of .editorconfig trim_trailing_whitespace = true doesn't seem to work in atom anymore, I dunno what exactly happened as it used to work just fine..

Running Atom 1.25.0 x64

IssueHunt Summary

Sponsors (Total: $40.00)

Become a sponsor now!

Or submit a pull request to get the deposits!

Tips

@florianb
Copy link
Collaborator

Hi @JourneyOver - thanks for getting in touch. I currently don't know about an issue with trim_trailing_whitespace.

Could you please provide the output of the command EditorConfig: Show State (Cmd + Shift + P) for the file where Editorconfig behaves malicious?

@florianb florianb added the bug label Mar 28, 2018
@JourneyOver
Copy link
Author

JourneyOver commented Mar 28, 2018

atom_03-28-2018_05-22-42 as an example of one of the many many misbehaving that used to work.

It doesn't throw any errors/warnings or anything since I disabled the whitespace package, and the popup that comes from the "show state" is green as shown above. One thing I noticed is that it's sometimes working and then sometimes not working..

I've noticed it not working on:

  • .ini
  • .txt
  • .json
  • .py
  • .pyw
  • .groovy
  • .css

to name at least a couple files by extension I've tested on so far (there could be more but that's at least the ones I've tested so far). It doesn't seem to matter the file name or anything, any file with the above extensions that I've at least tested on so far don't seem to want to use the trim_trailing_whitespace anymore..

Another thing that I noticed as well, is that if I'm making a new file (like haven't created/saved yet) after saving the file the trim_trailing_whitespace works but it only seems to work once, upon adding trailing whitespaces and saving again it doesn't remove any trialing whitespaces anymore except for if its on a new line without any words, if I add a word it again trims it only once upon save but if I go and add a trailing whitespace again after the word and save it doesn't remove the trailing whitespace.

example:

  1. Create a file (Use one of the extensions above)
  2. type a random word in the file with a trailing whitespace
  3. save (notice the trailing whitespace is now removed)
  4. add a new trailing whitespace after the word again
  5. Save (notice the trailing whitespace is not removed)
    Optionals:
  6. Create a new line and make a few whitespaces
  7. Save (notice the trailing whitespaces on the newline are gone)
  8. Follow from step 2 to 5 again.

--
If I go and use VSCode or notepad++ instead of Atom, editorconfig packages for them works just fine with my .editorconfig file, so I don't believe the issue is to do with my .editorconfig file any. Ontop of that things used to work just fine, and I haven't really changed anything on my end other than updating packages (I haven't added any new packages in a very long time) and updating atom.

@florianb
Copy link
Collaborator

@JourneyOver - thank you for your detailed description. Unfortunately i cannot reproduce the behavior. It looks very much like a different package is modifying your files after editorconfig left them alone.

You're using some packages which may probably interfere with the editorconfig-settings.

For example line-ending-converter or project-manager (i already had issues in conjunction with project-manager) - could you do me a favor and check, if disabling the other packages leads to a different behavior?

@JourneyOver
Copy link
Author

So I've temporarly disabled all of my packages other than editorconfig and the core packages (and themes/syntax) that atom comes with, and it's still producing the same issue..

Built-in Atom Packages (92)
├── atom-dark-syntax@0.29.0
├── atom-dark-ui@0.53.1
├── atom-light-syntax@0.29.0
├── atom-light-ui@0.46.1
├── base16-tomorrow-dark-theme@1.5.0
├── base16-tomorrow-light-theme@1.5.0
├── one-dark-ui@1.10.10
├── one-light-ui@1.10.10
├── one-dark-syntax@1.8.2
├── one-light-syntax@1.8.2
├── solarized-dark-syntax@1.1.4
├── solarized-light-syntax@1.1.4
├── about@1.8.0
├── archive-view@0.64.2
├── autocomplete-atom-api@0.10.7
├── autocomplete-css@0.17.5
├── autocomplete-html@0.8.4
├── autocomplete-plus@2.40.2
├── autocomplete-snippets@1.12.0
├── autoflow@0.29.3
├── autosave@0.24.6
├── background-tips@0.27.1
├── bookmarks@0.45.1
├── bracket-matcher@0.89.1
├── command-palette@0.43.5
├── dalek@0.2.1
├── deprecation-cop@0.56.9
├── dev-live-reload@0.48.1
├── encoding-selector@0.23.8
├── exception-reporting@0.43.1
├── find-and-replace@0.215.5
├── fuzzy-finder@1.7.5
├── github@0.10.3
├── git-diff@1.3.9
├── go-to-line@0.33.0
├── grammar-selector@0.49.9
├── image-view@0.62.4
├── incompatible-packages@0.27.3
├── keybinding-resolver@0.38.1
├── line-ending-selector@0.7.5
├── link@0.31.4
├── markdown-preview@0.159.20
├── metrics@1.2.6
├── notifications@0.70.2
├── open-on-github@1.3.1
├── package-generator@1.3.0
├── settings-view@0.254.1
├── snippets@1.3.1
├── spell-check@0.72.7 (disabled)
├── status-bar@1.8.15
├── styleguide@0.49.10
├── symbols-view@0.118.2
├── tabs@0.109.1
├── timecop@0.36.2
├── tree-view@0.221.3
├── update-package-dependencies@0.13.1
├── welcome@0.36.6
├── whitespace@0.37.5 (disabled)
├── wrap-guide@0.40.3
├── language-c@0.59.2
├── language-clojure@0.22.7
├── language-coffee-script@0.49.3
├── language-csharp@1.0.1
├── language-css@0.42.10
├── language-gfm@0.90.3 (disabled)
├── language-git@0.19.1
├── language-go@0.45.2
├── language-html@0.49.0
├── language-hyperlink@0.16.3
├── language-java@0.28.0
├── language-javascript@0.128.3
├── language-json@0.19.1
├── language-less@0.34.2
├── language-make@0.22.3
├── language-mustache@0.14.5
├── language-objective-c@0.15.1
├── language-perl@0.38.1
├── language-php@0.43.1
├── language-property-list@0.9.1
├── language-python@0.49.2
├── language-ruby@0.71.4
├── language-ruby-on-rails@0.25.3
├── language-sass@0.61.4
├── language-shellscript@0.26.1
├── language-source@0.9.0
├── language-sql@0.25.10
├── language-text@0.7.3
├── language-todo@0.29.4
├── language-toml@0.18.2
├── language-typescript@0.3.2
├── language-xml@0.35.2
└── language-yaml@0.31.2

Community Packages (63) C:\Users\JourneyOver\.atom\packages
├── aligner@1.2.4 (disabled)
├── aligner-javascript@1.3.0 (disabled)
├── ask-stack@2.2.0 (disabled)
├── atom-alignment@0.13.0 (disabled)
├── atom-beautify@0.32.2 (disabled)
├── atom-css-comb@3.3.1 (disabled)
├── atom-discord@1.5.1 (disabled)
├── atom-ide-ui@0.9.4 (disabled)
├── autoclose-html@0.23.0 (disabled)
├── batman-syntax@1.1.0
├── busy@0.7.0 (disabled)
├── busy-signal@1.4.3 (disabled)
├── convert-file-encoding@0.1.0 (disabled)
├── copy-path@0.5.1 (disabled)
├── editorconfig@2.2.2
├── file-icons@2.1.18 (disabled)
├── highlight-selected@0.13.1 (disabled)
├── ide-css@0.3.0 (disabled)
├── ide-python@0.9.1 (disabled)
├── intentions@1.1.5 (disabled)
├── language-autohotkey2@1.0.1 (disabled)
├── language-batch@0.4.0 (disabled)
├── language-groovy@0.7.0 (disabled)
├── language-lua@0.9.11 (disabled)
├── language-markdown@0.25.1 (disabled)
├── language-powershell@4.0.0 (disabled)
├── line-ending-converter@1.3.2 (disabled)
├── linter@2.2.0 (disabled)
├── linter-alex@4.0.0 (disabled)
├── linter-coffeelint@1.3.1 (disabled)
├── linter-csslint@2.0.0 (disabled)
├── linter-jshint@3.1.6 (disabled)
├── linter-proselint@3.3.0 (disabled)
├── linter-remark@5.1.0 (disabled)
├── linter-ruby@1.2.6 (disabled)
├── linter-shellcheck@1.4.6 (disabled)
├── linter-stylelint@4.2.0 (disabled)
├── linter-ui-default@1.7.1 (disabled)
├── markdown-lists@0.0.2 (disabled)
├── markdown-table-formatter@2.9.2 (disabled)
├── merge-conflicts@1.4.5 (disabled)
├── minimap@4.29.8 (disabled)
├── minimap-find-and-replace@4.5.2 (disabled)
├── minimap-git-diff@4.3.1 (disabled)
├── minimap-highlight-selected@4.6.1 (disabled)
├── minimap-linter@2.1.3 (disabled)
├── monokai-slate2@0.7.1
├── newton-dark-syntax@1.1.9
├── newton-dark-ui@1.1.3
├── pdf-view@0.67.0 (disabled)
├── pigments@0.40.2 (disabled)
├── platformio-ide-terminal@2.8.1 (disabled)
├── pretty-json@2.0.0 (disabled)
├── project-manager@3.3.5 (disabled)
├── regex-railroad-diagram@0.19.4 (disabled)
├── seti-syntax@1.1.3
├── seti-ui@1.10.0
├── split-diff@1.5.2 (disabled)
├── sync-settings@0.8.6 (disabled)
├── table-editor@0.2.2 (disabled)
├── tree-view-copy-relative-path@1.2.0 (disabled)
├── wakatime@7.0.4 (disabled)
└── wordcount@2.10.4 (disabled)

if I go to any file that I haven't mentioned with an extension in my last reply like say a powershell script .ps1 or say a markdown .md and add random whitespaces in the file it works fine, but if I try with any of the extensions that I mentioned in my last reply it still just goes and doesn't remove any whitespaces at all.

Another thing I'm noticing as well is that if it's a brand new file on first save it sometimes will glitch and not remove the whitespaces so sometimes #3 of my last reply is a fud (notice that when it does glitch like this on first save of a new file it wont add a new line either but any save after the first save will add a new line when needed)

@JourneyOver
Copy link
Author

I can just go and re-enable the whitespace package and it'll work just fine, but it'd be nice to get whitespace triming working on editorconfig so I can stop seeing that damn orange mouse in the taskbar of atom xD

@florianb
Copy link
Collaborator

I just saw you're already using Atom 1.25 - i guess this will be the cause for the troubles. 🙄

I will try to figure out what goes wrong here - expect an upcoming release. I'll come back to you when i have new information about the issue or i expect it to be resolved after a release.

@JourneyOver
Copy link
Author

Ah I hope it is the cause of all this, and not some other mysterious force at play..

Hope you can figure things out and get a fix out :D

@florianb florianb changed the title trim_trailing_whitespace no longer applying?? trim_trailing_whitespace no longer applying Mar 28, 2018
@bdube
Copy link

bdube commented May 9, 2018

I have this issue, too, in 1.26.1 x64. How can I help?

Also for me it's more than just trailing whitespace trimming that no longer works. I have the Show Invisibles setting enabled and that setting works when the file in the buffer is .editorconfig. It doesn't work for any other files.

@florianb
Copy link
Collaborator

@bdube thanks for getting in touch. I'm currently working on a rewrite. If you'd like i can ping you as soon as i pre-release the rewrite.

For the additional issue i'd like to ask you to open a new issue, since this seems to be a unrelated issue.

@florianb
Copy link
Collaborator

I decided to drop maintenance. Sorry.

See #231

@issuehunt-oss issuehunt-oss bot added the 💵 Funded on Issuehunt This issue has been funded on Issuehunt label May 28, 2019
@IssueHuntBot
Copy link

@IssueHunt has funded $40.00 to this issue.


@sasikanth513
Copy link

I just tested this functionality in atom 1.37.0 and followed the steps as mentioned by OP, everything is working fine.

Any one facing same issues? Any repo with files to reproduce this issue would be great. 😄

@Alhadis
Copy link
Collaborator

Alhadis commented Jul 5, 2019

Yeah, same. Unable to reproduce this whatsoever; I'm guessing I must've fixed it in a previous release. 😅

If you're still experiencing this, please let me know.

@Alhadis Alhadis closed this as completed Jul 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug 💵 Funded on Issuehunt This issue has been funded on Issuehunt untested
Projects
None yet
Development

No branches or pull requests

6 participants