Anthony Sottile
79a1b2676e
Handle crlf endings in fix-encoding-pragma
2019-05-15 10:04:18 -07:00
roottool
fc9fb8bfa8
Changed position of 'import io'
2019-04-22 04:24:41 +09:00
roottool
47c89785e8
Added newline
2019-04-22 04:17:09 +09:00
roottool
e7924b53e4
Changed from open() to io.open()
2019-04-22 03:48:18 +09:00
Anthony Sottile
053feb1e6f
Use AbstractSet to appease mypy
2019-04-20 16:21:58 -07:00
Marc Jay
a7af812449
Make optional argument use an immutable set for the default value
...
in no-commit-to-branch. Make other sets immutable to satisfy type-checking
and be consistent
2019-04-20 23:07:14 +01:00
Marc Jay
8d2785b9d6
Amend approach for no-commit-to-branch to use regex matching based on
...
feedback. Adds --pattern optional argument which can be used alongside
--branch to block commits to a branch which matches a supplied
regex expression
2019-04-20 13:46:49 +01:00
Marc Jay
d6847c4827
Add wildcard matching to no-commit-to-branch hook so that commits can
...
be blocked on, for example, all release branches with 'release/*'
2019-04-09 23:53:39 +01:00
Anthony Sottile
2f6a2515ec
Don't require an encoding for check-docstring-first
2019-03-30 15:31:42 -07:00
Anthony Sottile
8bb94f0bd4
azure pipelines [skip travis] [skip appveyor]
2019-03-10 16:56:44 -07: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
63cc3414e9
Updates for flake8 3.7
2019-01-30 00:15:11 -08:00
Anthony Sottile
e7158ce14d
pre-commit autoupdate
2019-01-02 10:31:51 -08:00
Anthony Sottile
a762639038
switch from pyyaml to ruamel.yaml
2018-12-28 13:09:17 -08:00
Andy Gimblett
59ed512020
In mixed-line-endings, move check/print to main() as suggested by asottile (PR 341)
2018-11-26 17:35:03 +00:00
Andy Gimblett
f3c65bcd20
Report failing filenames when --fix=no in mixed-line-endings
2018-11-26 10:17:52 +00:00
Ryan Delaney
0d83fed4fa
Reword usage info to clarify required usage syntax
2018-10-28 16:00:01 -07:00
Ryan Delaney
2d4833c73e
Rename metavar to clarify required usage syntax
2018-10-28 15:58:14 -07:00
Ryan Delaney
b1feed0ced
Add ban for pgp/gpg private key blocks
2018-10-22 12:11:59 -07:00
mtkennerly
e694a6cfc2
Incorporate patch to support isolated CR
2018-10-13 19:44:02 -04:00
mtkennerly
2ab5832ce1
Preserve CRLF if file already ends that way
2018-10-13 19:00:22 -04:00
mtkennerly
abd3d0ec3f
Fix CRLF lines
2018-10-13 07:26:53 -04:00
Anthony Sottile
08e2918d60
Merge pull request #321 from pre-commit/suggest_mirrors_autopep8
...
Remove autopep8-wrapper in favor of autopep8
2018-10-12 19:23:26 -07:00
Anthony Sottile
99453a5366
Default --no-markdown-linebreak-ext for trailing-whitespace
2018-10-12 18:15:39 -07:00
Anthony Sottile
526904b159
Remove autopep8-wrapper in favor of autopep8
2018-10-11 17:19:35 -07:00
Vinay Karanam
64b9f3dcf0
Added --assume-in-merge option for check-merge-conflict
...
Fixes #300
2018-06-26 23:59:40 +05:30
Anthony Sottile
9bf684c131
Merge pull request #297 from pre-commit/warnings
...
Fix resource warnings
2018-06-18 08:21:00 -07:00
Anthony Sottile
5dc306b35d
Fix resource warnings
2018-06-18 00:00:38 -07:00
Anthony Sottile
6239384547
Fix invalid escape sequences
2018-06-17 23:52:13 -07:00
Anthony Sottile
baec308367
Allow multiple branches to be protected
...
Original patch by @moas
2018-06-09 11:18:33 -07:00
Anthony Sottile
c72ad40a6d
Improve vcs regex (don't match whitespace)
2018-06-04 10:10:14 -07:00
vin01
45d3850244
Detect putty & sshcom private keys
2018-05-19 00:31:16 +01:00
Anthony Sottile
df93509aed
Explicitly check for `ast.Name`
2018-05-17 17:14:25 -07:00
Anthony Sottile
18b3ab7cd2
debug-statements: detect python3.7+ breakpoint()
2018-05-13 15:28:39 -07:00
Michał Sochoń
54c0f8c937
Open files as UTF-8
2018-03-26 12:00:48 +02:00
Michał Sochoń
980fc9bdc3
Fix flake8 error
...
Forgot to rename one var...
2018-03-26 00:41:21 +02:00
Michał Sochoń
b0d44c7084
Ensure not to alter list in 'for' loop
2018-03-26 00:17:13 +02:00
Michał Sochoń
9e28aaf275
Simplify check, extend README
2018-03-26 00:02:23 +02:00
Michał Sochoń
1d6ad0d6ed
Provide automatic removal of pkg-resources==0.0.0
...
Should help to deal with that pretty paintuly issue under Ubuntu/Debian
family:
https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1635463
2018-03-25 23:34:02 +02:00
Anthony Sottile
a21def36e3
Add an `--unsafe` option to `check-yaml`
2018-03-19 09:28:18 -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
93f319c1f8
Fix no-commit-to-branch when not on a branch
2018-02-19 12:56:14 -08:00
Pablo Vega
83fca4c614
Adding a check to make sure either spaces or null values are not mistakenly added into the key variable
2018-01-26 00:28:39 -08:00
nicain
70ee59f9e6
Update detect_private_key.py
2018-01-13 17:16:50 -08:00
Anthony Sottile
cf04ab0186
Merge pull request #254 from cas--/refactor/pretty-format-json
...
Refactor/pretty format json
2017-12-11 08:33:13 -08:00
Calum Lind
5b6ddaf9f7
Fix pretty_format_json to use int indent
...
The indent parameter for json should be integer and under Python2 is
will raise an error if not. So switch from str to int and mention
default value in help text.
2017-12-10 22:33:33 +00:00
Calum Lind
00974efa31
Remove pretty_format_json simplejson dependency
...
* The simplejson module is only needed for <=py25 so replace with builtin json.
* Replace six dependecy for simple Py2 check for convertion to unicode.
* Cleanup quotes.
2017-12-10 22:33:33 +00:00
Ben Webber
775867626d
check-builtin-literals: Ignore function attribute calls
2017-11-30 18:33:36 +00:00
Ben Webber
35996b7a25
Add check to enforce literal syntax for Python builtin types
...
This check requires authors to initialize empty or zero builtin types
using the literal syntax (e.g., `{}` instead of `dict()`).
Authors may ignore this requirement for certain builtins using the
`--ignore` option.
Authors may also forbid calling `dict()` with keyword arguments
(`dict(a=1, b=2)`) using the `--no-allow-dict-kwargs` flag.
2017-11-26 00:46:03 +00:00
Anthony Sottile
9567db66e5
Add a flush
2017-10-18 14:46:38 -07:00
Anthony Sottile
e87b81afd9
Add an --allow-multiple-documents option to check-yaml
2017-10-12 15:52:10 -07:00
Anthony Sottile
361a6ac1bc
Merge pull request #243 from pre-commit/comment_only_requirements_txt
...
Fix requirements-txt-fixer for comments at end of file
2017-10-09 11:27:52 -07:00
Anthony Sottile
86691eda47
Fix requirements-txt-fixer for comments at end of file
2017-10-09 10:59:17 -07:00
Anthony Sottile
9958d1e219
Fix trailing-whitespace on macos for non-utf8 files
2017-10-09 10:47:41 -07:00
Anthony Sottile
9db0a745f6
Add hook for ensuring vcs permalinks
2017-10-06 23:37:13 -07:00
Anthony Sottile
76047f6eef
Fix mixed-line-endings --fix=... when whole file is a different ending
2017-09-27 07:47:24 -07:00
Anthony Sottile
fbcd096ea9
Simplify mixed-line-ending hook
2017-09-05 20:25:39 -07:00
Morgan Courbet
fc8a5b27e9
Add mixed-line-ending hook
2017-09-05 19:30:55 -07:00
Anthony Sottile
2913408db3
debug statements hook works for non-utf8 files
2017-08-14 20:20:32 -07:00
Anthony Sottile
0c5f040a7f
Use new git lfs (broken due to lfs returning non-lfs files)
2017-07-26 02:59:08 -07:00
Anthony Sottile
e9aea74a77
Upgrade add-trailing-comma to 0.4.1
2017-07-15 13:06:38 -07:00
Anthony Sottile
2a902e0a07
Use asottile/add-trailing-comma
2017-07-12 18:58:30 -07:00
Anthony Sottile
8ad9e7c94c
Report full version in check-ast
2017-07-05 12:38:21 -07:00
Chris Kuehl
13991f09d2
Add a checker for executables without shebangs
2017-07-02 21:14:25 -07:00
Anthony Sottile
aa50988889
Merge pull request #199 from pre-commit/rebase_conflict
...
Support rebase conflicts in check-merge-conflicts
2017-07-02 19:43:55 -07:00
Daniel Gallagher
7102e0c8a3
file-contents-sorter should add newline at end of files missing newlines
...
Make an explicit 'else' path for readability
2017-06-26 08:10:32 -07:00
Daniel Gallagher
7cfec24f77
Fix bug with the file-contents-sorter hook when processing file that does not end in a newline
2017-06-25 14:40:03 -07:00
Anthony Sottile
50871f83cc
Merge pull request #206 from dlgallagher/requirements_txt_fixer_followup
...
Some style tweaks (requirements_txt_fixer)
2017-06-25 14:53:25 -04:00
Daniel Gallagher
4c421e2ed1
Put argument parsing back into main()
2017-06-25 10:22:10 -07:00
Daniel Gallagher
844d9830de
Some style tweaks
2017-06-25 10:14:58 -07:00
Daniel Gallagher
d188f2ecf8
Merge branch 'master' into file_contents_sorter_hook
2017-06-25 09:39:21 -07:00
Anthony Sottile
d419bef35c
Merge pull request #205 from dlgallagher/fix_requirements_txt_fixer_on_empty_requirements_files
...
Fix NoneTypeError when requirements file is empty
2017-06-24 00:35:39 -04:00
Daniel Gallagher
7ccfa05f2f
Fix NoneTypeError when requirements file is empty
2017-06-23 17:19:21 -07:00
Daniel Gallagher
b6eff3d39e
Add sort-simple-yaml hook (originally private hook from yelp_pre_commit_hooks)
2017-06-23 16:26:00 -07:00
Daniel Gallagher
b941d0e6df
Respond to review feedback
2017-06-23 14:58:24 -07:00
Daniel Gallagher
9425c5d6b5
First commit of file-contents-sorter precommit hook
2017-06-23 00:33:13 -07:00
Anthony Sottile
6076fd1b15
Support rebase conflicts in check-merge-conflicts
2017-06-12 10:39:07 -07:00
Anthony Sottile
dc50b7f09c
Attempt to fix the json hook under test
2017-03-20 11:25:45 -07:00
Evan Felix
a8592669d9
Add a no commit to specific branch hook. ( #185 )
...
* add no commit code and config
* add the code
* remove version tweak
* fix logic, remove newline
* add Tests and cleanup testing issues
* remove extraneous modules
* cleanup some pep8 and flake issues
* reorder imports
* more fixes for syntax checking
* code cleanup based off asottile comments
* Use Contractions Properly, alphabatize new hook.
* Adding support for branches with a slash in them.
2017-03-20 10:36:51 -07:00
Anthony Sottile
b95dcad616
Fixups
2017-03-20 08:24:58 -07:00
John Hu
543c5c7e1a
Add an option to disable ensure_ascii
2017-03-20 20:19:01 +08:00
Oliver Zhou
c380d0b3e3
Handling default django test filename of "tests.py"
2017-03-15 00:40:53 -07:00
Anthony Sottile
9cee71b5df
Add pyupgrade
2017-03-12 18:01:29 -07:00
Mike Fiedler
312e721ce9
Add flag to detect-aws-credentials to allow missing keys
...
In the event that there exists no configuration for AWS credentials and
they are not exported in to the current environment, a flag may be
passed to allow exiting the hook successfully.
Resolves #174
Signed-off-by: Mike Fiedler <miketheman@gmail.com>
2017-02-10 12:54:03 -05:00
Anthony Sottile
81147337c5
Only return nonzero when rewriting whitespace
2017-02-07 09:45:31 -08:00
Anthony Sottile
5da199bb8d
Formatting fixups
2017-01-03 13:13:44 -08:00
Anthony Sottile
47996656b4
Merge pull request #162 from Dunedan/improve-aws-credential-searching
...
Improve searching for configured AWS credentials
2017-01-03 16:11:30 -05:00
Anthony Sottile
a7971b7d26
appveyor installed git-lfs, fix coverage
2017-01-03 12:56:22 -08:00
Daniel Roschka
3939aee4a3
Address issues mentioned in review
2017-01-03 19:05:49 +01:00
Daniel Roschka
0fd09bf67a
Add AWS_CONFIG_FILE to the environment variables
...
Turns out there is an additional environment variable AWS_CONFIG_FILE,
which gets evaluated for finding configuration files as well. This
commit adds support for it.
2016-12-30 10:39:38 +01:00
Daniel Roschka
b0d4cdb1ee
Improve searching for configured AWS credentials
...
The previous approach for finding AWS credentials was pretty naive and
only covered contents of a single file (~/.aws/credentials by
default).
The AWS CLI documentation states various other ways to configure
credentials which weren't covered:
https://docs.aws.amazon.com/cli/latest/topic/config-vars.html#credentials
Even that aren't all ways, a look into the code shows:
https://github.com/boto/botocore/blob/develop/botocore/credentials.py
This commit changes the behavior so the hook will behave in a way
that if the AWS CLI is able to obtain credentials from local files,
the hook will find them as well.
The changes in detail are:
- detect AWS session tokens and handle them like secret keys.
- always search credentials in the default AWS CLI file locations
( ~/.aws/config, ~/.aws/credentials, /etc/boto.cfg and ~/.boto)
- detect AWS credentials configured via environment variables in
AWS_SECRET_ACCESS_KEY, AWS_SECURITY_TOKEN and AWS_SESSION_TOKEN
- check additional configuration files configured via environment
variables (AWS_CREDENTIAL_FILE, AWS_SHARED_CREDENTIALS_FILE and
BOTO_CONFIG)
- print out the first four characters of each secret found in files to
be checked in, to make it easier to figure out, what the secrets
were, which were going to be checked in
- improve error handling for parsing ini-files
- improve tests
There is a major functional change introduced by this commit:
Locations the AWS CLI gets credentials from are always searched and
there is no way to disable them. --credentials-file is still there to
specify one or more additional files to search credentials in. It's
the purpose of this hook to find and check files for found
credentials, so it should work in any case. As this commit also
improves error handling for not-existing or malformed configuration
files, it should be no big deal.
Receiving credentials via the EC2 and ECS meta data services is not
covered intentionally, to not further increase the amount of changes
in this commit and as it's probably an edge case anyway to have this
hook running in such an environment.
2016-12-30 08:41:24 +01:00
Chris Kuehl
cdb3e2e4bf
Add trailing comma
2016-12-26 14:51:26 -08:00
Daniel Roschka
c549cb25a1
Detect Ed25519 keys as well
...
Ed255519 keys generated by OpenSSH contain "BEGIN OPENSSH PRIVATE KEY"
as identifier. This commit adds coverage for such keys as well.
2016-12-26 19:09:53 +01:00
Chris Kuehl
4b928ab06b
Add forbid-new-submodules to hooks.yaml
2016-11-30 10:25:51 -08:00
Anthony Sottile
70e405ede2
Add a new hook to forbid new submodules
2016-11-30 09:56:42 -08:00
Chris Kuehl
6b9265c96a
Fix JSON decode error message
2016-11-12 11:54:14 -08:00
Lucas Cimon
54e83f7ceb
Displaying the filename when the check-json hook fails with a UnicodeDecodeError - fix #148
2016-11-12 09:15:10 +01:00
dmlb2000
84b1fb6827
let pre-commit fix some stuff
2016-11-03 15:54:48 -07:00
dmlb2000
c7ab197645
don't need to blow away the space here
2016-11-03 15:49:04 -07:00
dmlb2000
d06a515ce1
this is much cleaner and might actually get all the coverage with out a bunch of work
2016-11-03 15:47:21 -07:00
dmlb2000
845a3d5bdf
adds top keys list of keys in hashes to put at the top of a hash
...
This adds custom sorting to preferencially add a list of top keys
at the start of any json hash in the json document
2016-11-03 09:41:23 -07:00
Brett Delle Grazie
a234b23667
Use safe_load as per PyYAML documentation
...
resolves #104
2016-10-23 17:50:42 +01:00
Anthony Sottile
1858edd9da
Merge pull request #135 from Lucas-C/master
...
trailing-whitespace hook: restoring original file in case of failure - fixes #134
2016-08-31 07:35:34 -07: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
Anthony Sottile
8be6f4c77e
Remove pylint
2016-08-22 14:38:49 -07: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
Anthony Sottile
a43122c5f4
Merge pull request #133 from pre-commit/customizable_encoding_pragma
...
Allow encoding pragma to be customizable
2016-08-12 19:19:28 +02:00
Anthony Sottile
693709e761
Allow encoding pragma to be customizable
2016-08-12 10:11:10 -07:00
Vinay Karanam
81bd74d9c3
coverage fix
2016-07-03 04:31:19 +05:30
Vinay Karanam
c58ae08fed
requirements fixer output is similar to pip freeze
2016-07-03 04:10:20 +05:30
Oscar-Garcia
ea320d7463
Update debug_statement_hook.py
...
Adds celery rdb as debugger: http://docs.celeryproject.org/en/latest/tutorials/debugging.html
2016-06-20 09:41:22 +02:00
Anthony Sottile
6dfcb89af3
Merge pull request #122 from sanmai-NL/JSON_arbitrary_indentation_separator
...
Fix exception raising logic to match validation issues
2016-06-13 08:50:53 -07:00
Sander Maijers
abaf0d12de
Fix exc. raising logic to match validation issues
2016-06-13 11:34:55 +02:00
Anthony Sottile
cf3aabe9b1
Merge pull request #120 from sanmai-NL/JSON_arbitrary_indentation_separator
...
Refactor legacy `indent: int` -> `indent: str`
2016-06-12 10:25:59 -07:00
Sander Maijers
a5628863e8
Refactor legacy `indent: int` -> `indent: str`
...
The type of `indent` parameter is preferably `str`. See
http://simplejson.readthedocs.io/en/latest/index.html?highlight=dump#simplejson.dump
. This change allows to specify TABs as indentation delimiter to
`pretty_format_json`. Add input validator/converter for backward compat.
2016-06-12 19:19:07 +02:00
Anthony Sottile
4a01f64c8f
Fix check-merge-conflict against binary files
2016-05-26 11:20:32 -07:00
Anthony Sottile
03bf17f2b0
Add a --remove option to fix-encoding-pragma
2016-04-27 11:18:14 -07:00
Anthony Sottile
17478a0a50
Style fixups
2016-04-14 08:25:52 -07:00
Anthony Sottile
ea867c2e68
Merge pull request #109 from mattclegg/no-sort-keys
...
Adding no-sort-keys to pretty_format_json
2016-04-14 08:11:26 -07:00
mattclegg
f775891717
Drop messy py26 support in favour of 100% coverage
2016-04-14 11:16:18 +01:00
mattclegg
700b18ed0e
Use OrderedDict to preserve order
2016-04-14 10:23:42 +01:00
Anthony Sottile
fe9c404019
Forbid files with a UTF-8 BOM
2016-03-18 10:59:31 -07:00
Sébastien Larivière
f769c208bc
Addding no-sort-keys to pretty_format_json, this allows to disable the sort on the keys
2016-03-12 17:04:33 -05:00
Anthony Sottile
d444ab821d
Improve error message when credentials file is not provided
2016-02-08 17:18:56 -08:00
Anthony Sottile
d740faeded
Typo in no cover comment
2016-02-03 11:12:51 -08:00
Anthony Sottile
8d80d51cad
Fix coverage on check_symlinks for windows
2016-01-15 07:41:58 -08:00
Anthony Sottile
eff3eafcbb
Merge pull request #98 from bchess/check_symlinks
...
New hook tests for broken symlinks
2016-01-15 07:38:46 -08:00
Anthony Sottile
d466a2e52c
no cover some non-lfs lines
2016-01-14 18:57:03 -08:00
Benjamin Chess
896c0cfdc0
new hook tests for broken symlinks
2016-01-14 15:25:46 -08:00
Anthony Sottile
3f6f23d73f
Teach check-large-files-added about git-lfs. Reslves #82 .
2015-12-28 05:38:06 -08:00
Corey Christous
a23c58298c
Reformatted --diff-filter git argument
...
This makes the command compatible with older versions of git.
2015-12-01 16:59:22 -05:00
phoxelua
58edfc8af6
Fixed regex matching
2015-11-19 00:39:29 -08:00
Anthony Sottile
aa2ba6f94f
Add encoding pragma hook. Resolves pre-commit/pre-commit#15
2015-11-13 12:39:43 -08:00
Dean Wilson
a6665279e7
Show names of files containing aws credentials
2015-10-28 05:13:37 +00:00
Chris Kuehl
a1b0104f3d
Sort requirements.txt case-insensitively
2015-08-17 12:43:13 -07:00
Anthony Sottile
8a8aaf5a60
Add a hook to verify python ast.
2015-08-04 13:48:30 -07:00
Chris Kuehl
ca2be345a1
detect_private_key: print *filenames*, not the key
2015-08-01 17:02:29 -07:00
Anthony Sottile
99574324eb
Merge pull request #60 from arahayrabedian/master
...
AWS credential checking
2015-06-17 11:46:15 -07:00
Ara Hayrabedian
974ef4e93c
disable import checking for six.moves
2015-06-13 14:18:08 +04:00
Ara Hayrabedian
02e8bdc9d8
add tests, test sample files and minor refactor of exit codes in actual hook in order to facilitate testing
2015-06-12 19:20:56 +04:00
Ara Hayrabedian
88725503c4
remove print statement
2015-06-12 17:02:06 +04:00
Ara Hayrabedian
3078aec57b
use six for config parser, add to reqs
...
ditch checkign access_key (don't consider these a secret)
don't check line by line, check the whole file in bulk instead
2015-06-12 16:24:01 +04:00
Anthony Sottile
07c938e1b1
Allow arbitrary binary to pass the private key hook check. Resolves #64
2015-06-11 13:28:10 -07:00
Léo Cavaillé
55bf22dc4a
Add new hook pretty-format-json
...
This new hook allows to standardize one's JSON files (sorted key/4
spaces indent).
By default it just fails if any file is not complying with the standard,
but you can also pass the arg `--autofix` and the hook will
pretty-format the file itself.
Good in use combined with the `check-json` hook.
2015-06-11 00:08:03 -04:00
Ara Hayrabedian
95bf20d52d
add aws credential checking ONLY FOR YOUR OWN credentials if they're set in a configurable credentials file (AWS CLI tools' native format)
2015-06-01 23:16:51 +04: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