Commit graph

30 commits

Author SHA1 Message Date
Anthony Sottile
a49f812a96 py39+
Committed via https://github.com/asottile/all-repos
2024-10-11 19:30:07 -04:00
Anthony Sottile
8f6152921e drop python3.6 support
python 3.6 reached end of life on 2021-12-23

Committed via https://github.com/asottile/all-repos
2022-01-15 19:24:05 -05:00
Anthony Sottile
39ab2ed85e replace exit(main()) with raise SystemExit(main())
Committed via https://github.com/asottile/all-repos
2021-10-23 13:23:50 -04:00
Anthony Sottile
f5c42a050b pre-commit-hooks: python3.6+ 2020-02-05 11:22:18 -08:00
iconmaster5326
a33a8f0d8a Change parameter name to "chars" and move encoding outside loop 2019-10-25 12:20:04 -04:00
Iconmaster
dcbf43489c
Apply suggestion: the bytes(...) call does nothing here 2019-10-25 12:15:11 -04:00
iconmaster5326
c431f09ac3 Fix failure on Python 2 2019-10-25 11:54:00 -04:00
iconmaster5326
a2f836a23b fix-whitespace: Added test for custom charsets 2019-10-25 11:34:26 -04:00
iconmaster5326
886dfc4205 trailing-whitespace: add option for custom chars to strip 2019-10-25 11:12:49 -04:00
Anthony Sottile
8626e266dd double-quote-string-fixer 2019-02-11 19:57:37 -08:00
Anthony Sottile
4575652bd2 Use default flake8 config 2019-02-11 19:56:15 -08:00
Anthony Sottile
030bfac7e4 Apply typing to all of pre-commit-hooks 2019-01-31 20:09:15 -08:00
Anthony Sottile
99453a5366 Default --no-markdown-linebreak-ext for trailing-whitespace 2018-10-12 18:15:39 -07:00
Anthony Sottile
38e02ff508 Don't add end-of-file newline while trimming whitespace 2018-02-28 08:43:07 -08:00
Anthony Sottile
9958d1e219 Fix trailing-whitespace on macos for non-utf8 files 2017-10-09 10:47:41 -07:00
Anthony Sottile
2a902e0a07 Use asottile/add-trailing-comma 2017-07-12 18:58:30 -07:00
Anthony Sottile
9cee71b5df Add pyupgrade 2017-03-12 18:01:29 -07:00
Anthony Sottile
81147337c5 Only return nonzero when rewriting whitespace 2017-02-07 09:45:31 -08:00
Lucas Cimon
cb23c48b0d Post-review fixes 2016-08-31 11:44:59 +02:00
Lucas Cimon
c3c870c398 trailing-whitespace hook: support for CRLFs 2016-08-30 10:34:06 +01:00
Lucas Cimon
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
Lucas Cimon
bc5e7f2d72 trailing-whitespace hook: restoring original file in case of failure - fixes #134 2016-08-19 18:26:33 +02:00
Alexander Dupuy
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
Anthony Sottile
713fab4bc7 Remove dependency on plumbum 2015-03-20 14:15:30 -07:00
Anthony Sottile
b08f834d65 Update pre-commit hooks 2015-01-04 16:05:54 -08:00
Anthony Sottile
2f1d2bbe5b Remove @entry decorator (and misc cleanup) 2015-01-04 11:08:53 -08:00
Anthony Sottile
e3312c773e Use fileinput instead of sed. 2014-12-23 12:05:49 -08:00
Anthony Sottile
b80ca9e84a Update project setup. 2014-04-13 22:09:26 -07:00
Anthony Sottile
45741545dc Refactored how entry points work. 2014-03-22 18:21:54 -07:00
Anthony Sottile
acd9eaf6ed Add trailing whitespace fixer. 2014-03-14 15:18:29 -07:00