Skip to content

Files

Latest commit

 

History

History
22 lines (14 loc) · 700 Bytes

trailing-whitespace.md

File metadata and controls

22 lines (14 loc) · 700 Bytes

Pattern: Trailing whitespace

Issue: -

Description

This rule enforces PEP 8 recommendation to 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.

Example of incorrect code:

print('some trailing whitespace after this statement')   

Example of correct code:

print('no trailing whitespace')

Further Reading