Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Documentation is too sparse #194

Open
max-rocket-internet opened this issue Aug 4, 2020 · 2 comments
Open

Documentation is too sparse #194

max-rocket-internet opened this issue Aug 4, 2020 · 2 comments

Comments

@max-rocket-internet
Copy link

I'm here because I need to stop Atom from removing trailing whitespace and blank lines containing spaces for a particular Python project.

I just want to know how to:

  1. Make config apply within a single project only
  2. Target Python language files only

It seems there is only a very brief project README and no other docs or examples?

@wjandrea
Copy link

wjandrea commented Nov 24, 2021

Targeting a specific language is already covered in the README.

For per-project config, try Atomic Management. It works for my case where I need to disable ensureSingleTrailingNewline for all languages in a project. Your .atom/config.cson would look something like this:

'.source.python':
  whitespace:
    removeTrailingWhitespace: false

By the way, maybe you already know this, but PEP 8 recommends avoiding trailing whitespace entirely in Python, including lines containing only whitespace:

Avoid trailing whitespace anywhere. Because it's usually invisible, it can be confusing: e.g. a backslash followed by a space and a newline does not count as a line continuation marker. Some editors don't preserve it and many projects (like CPython itself) have pre-commit hooks that reject it.

Hypothetically, if the trailing whitespace is inside triple-quoted strings, as a workaround you could replace it with escapes, like \x20 for a space.

@wjandrea
Copy link

@max-rocket-internet FYI, I updated my above comment cause I found a solution and my original suggestion about a keymap was bogus.

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

No branches or pull requests

2 participants