14 Commits

Author SHA1 Message Date
9cee71b5df Add pyupgrade 2017-03-12 18:01:29 -07:00
81147337c5 Only return nonzero when rewriting whitespace 2017-02-07 09:45:31 -08:00
cb23c48b0d Post-review fixes 2016-08-31 11:44:59 +02:00
c3c870c398 trailing-whitespace hook: support for CRLFs 2016-08-30 10:34:06 +01:00
eaad923dd4 trailing-whitespace hook: Switching from using fileinput to a tempfile and whitespace substitution in binary mode 2016-08-20 11:59:10 +01:00
bc5e7f2d72 trailing-whitespace hook: restoring original file in case of failure - fixes #134 2016-08-19 18:26:33 +02:00
a6023ac0d7 Implement Markdown trailing space line break preservation
Markdown uses two or more trailing spaces on a line to indicate a forced
line break `<br/>` - these will be preserved for files with a markdown
extension (default = `.md` or `.markdown`).

Add `--markdown-linebreak-ext=X,Y` to add extensions (`*` matches any),
and `--no-markdown-linebreak-ext` to disable this feature.

If you want to set specific extension `foo` only (and not md/markdown),
use `--no-markdown-linebreak-ext --markdown-linebreak-ext=foo`

Tries to prevent --markdown-linebreak-ext from eating filenames as if they were
extensions by rejecting any with '.' or '/' (or even Windows-style '\' or ':')

Update README.md to include information on these arguments as well as
arguments added to other hooks

Add extensive tests using pytest.mark.parametrize

test that `txt` file is not considered as 'txt' extension
test that `.txt` file is not considered as 'txt' extension

The latter is the (correct) behavior of os.path.splitext(), and an example
of why it is better to use the libraries than to mangle strings yourself.
2015-05-11 08:52:32 +02:00
713fab4bc7 Remove dependency on plumbum 2015-03-20 14:15:30 -07:00
b08f834d65 Update pre-commit hooks 2015-01-04 16:05:54 -08:00
2f1d2bbe5b Remove @entry decorator (and misc cleanup) 2015-01-04 11:08:53 -08:00
e3312c773e Use fileinput instead of sed. 2014-12-23 12:05:49 -08:00
b80ca9e84a Update project setup. 2014-04-13 22:09:26 -07:00
45741545dc Refactored how entry points work. 2014-03-22 18:21:54 -07:00
acd9eaf6ed Add trailing whitespace fixer. 2014-03-14 15:18:29 -07:00