Commit Graph

1135 Commits

Author SHA1 Message Date
Anthony Sottile 78fd6916dd Merge pull request #90 from cchristous/master
Reformatted --diff-filter git argument
2015-12-01 14:05:54 -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
Anthony Sottile 0ff8620e03 Merge pull request #89 from phoxelua/master
Fixed regex matching for django test file names
2015-11-19 06:43:08 -08:00
phoxelua 58edfc8af6 Fixed regex matching 2015-11-19 00:39:29 -08:00
Anthony Sottile daa1e9a837 Merge pull request #87 from pre-commit/encoding_pragma_hook
Add encoding pragma hook.  Resolves pre-commit/pre-commit#15
2015-11-13 14:09:44 -08:00
Anthony Sottile aa2ba6f94f Add encoding pragma hook. Resolves pre-commit/pre-commit#15 2015-11-13 12:39:43 -08:00
Anthony Sottile 29bf11d136 Merge pull request #85 from deanwilson/aws_detected_filenames
Show names of files containing aws credentials
2015-10-28 09:50:57 -07:00
Dean Wilson a6665279e7 Show names of files containing aws credentials 2015-10-28 05:13:37 +00:00
Anthony Sottile edb5d5219e Merge pull request #84 from pre-commit/update_description_about_autopep8
Update description about autopep8.  Closes #83
2015-10-18 12:36:53 -07:00
Anthony Sottile 44fbe61e3d Update description about autopep8. Closes #83 2015-10-18 12:36:14 -07:00
Anthony Sottile f82fb149af Add C, C++ to whitespace hooks 2015-09-23 13:29:30 -07:00
Anthony Sottile 616c1ebd18 Merge pull request #79 from chriskuehl/requirements-sorter-nocase
Sort requirements.txt case-insensitively
2015-08-17 12:55:56 -07:00
Chris Kuehl a1b0104f3d Sort requirements.txt case-insensitively 2015-08-17 12:43:13 -07:00
Anthony Sottile c2992bd3a1 Merge pull request #77 from pre-commit/check_ast_hook
Add a hook to verify python ast.
2015-08-04 13:58:11 -07:00
Anthony Sottile 8a8aaf5a60 Add a hook to verify python ast. 2015-08-04 13:48:30 -07:00
Anthony Sottile 003e43251a Merge pull request #76 from chriskuehl/private-key-print-only-filename
detect_private_key: print *filenames*, not the key
2015-08-01 20:08:17 -04:00
Chris Kuehl ca2be345a1 detect_private_key: print *filenames*, not the key 2015-08-01 17:02:29 -07:00
Anthony Sottile 5dd2605fbe Merge pull request #75 from chriskuehl/add-pp-to-extensions
Add .pp (Puppet manifest) to file extensions lists
2015-07-28 08:01:36 -04:00
Chris Kuehl 500b279eaa Add .pp (Puppet manifest) to file extensions lists 2015-07-27 21:23:02 -07:00
Anthony Sottile 516cc9fa72 Allow six to bump 2015-06-17 11:49:19 -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 993c05be65 update readme to reflect that we no longer check for access keys, only secrets 2015-06-13 16:32:30 +04:00
Ara Hayrabedian 974ef4e93c disable import checking for six.moves 2015-06-13 14:18:08 +04:00
Ara Hayrabedian 255af75d1f add six to installation requirements 2015-06-12 19:21:14 +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 0d88124ef6 Merge pull request #66 from pre-commit/binary_detect_private_key_64
Allow arbitrary binary to pass the private key hook check.  Resolves #64
2015-06-11 14:43:43 -07:00
Anthony Sottile 07c938e1b1 Allow arbitrary binary to pass the private key hook check. Resolves #64 2015-06-11 13:28:10 -07:00
Anthony Sottile 6077f2fefb Merge pull request #65 from LeoCavaille/master
Add new hook pretty-format-json
2015-06-10 21:44:43 -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
Anthony Sottile cf550fcab3 v0.4.2 2015-05-31 14:02:52 -07:00
Anthony Sottile f138e3451b Update hooks 2015-05-31 13:51:02 -07:00
Anthony Sottile 5656e3cc30 Bump hooks 2015-05-31 13:47:21 -07:00
Anthony Sottile 9ba5af45ce Fix #59 by removing direct dependency on pyflakes 2015-05-31 13:46:47 -07:00
Anthony Sottile 2dda836789 tox-- 2015-05-16 19:11:06 -07:00
Anthony Sottile a00c16b8a3 Merge pull request #58 from dupuy/markdown-trailing-whitespace
Implement Markdown trailing space line break preservation
2015-05-11 06:51:38 -07: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 822d83a142 Merge pull request #56 from dupuy/avoid-markup-merge-conflict-fp-2
refactor detect_merge_conflict_test.py
2015-05-08 20:38:34 -07:00
Anthony Sottile 16a4e68d88 Merge pull request #55 from dupuy/avoid-markup-merge-conflict-fp
Don't report markup titles as merge conflicts
2015-05-08 20:38:17 -07:00
Alexander Dupuy 5c752935fd Refactor check-merge-conflicts tests
Do a straight test of detecting a real merge conflict as generated by git.
Test artificial conflict detection while pending merge without a real conflict.
Test artificial non-conflict non-detection in a resolved merge conflict.
Rename test_does_not_care... function to reflect what we want to care about.
Rename is_in_merge_conflict to is_in_merge since that is what it checks.
2015-05-09 04:29:38 +02:00
Alexander Dupuy eefc46f901 Don't report markup titles as merge conflicts
Several markup formats, such as Markdown or Re(Structured)Text
can format titles as text with '=' characters as double underlining,
like this:
```
My Page Title
=============

Lorem ipsum...
```

Rather that considering any line starting with seven '=' as a conflict marker,
require a space (or line-ending newline) after the equals.
This could still create a false positive for a seven character title,
like "Problem", but the markup formats generally allow extra '=' characters,
so by formatting the text like this:
```
Problem
========

Not...
```
these pre-commit warnings can be avoided.

Also updates the tests to add newlines for more realistic conflict files
(while a file might not end with a newline, conflict markers will).
Prevent false negative on test_does_not_care_when_not_in_a_conflict()
by making sure that README.md contains a line identical to a conflict string
(exactly seven '=' followed by a newline).
2015-05-09 04:20:38 +02:00
Anthony Sottile cedcea550c Merge pull request #54 from rhoml/rhoml/add-eyaml-support
Add eyaml support for check-yaml hook
2015-04-16 00:50:57 -04:00
Rhommel Lamas efb691467b Add eyaml support for check-yaml hook 2015-04-16 13:53:19 +10:00
Anthony Sottile 2d83e302cc Merge pull request #53 from mythmon/patch-1
Add q as a debug statement
2015-04-10 14:18:36 -04:00
Mike Cooper edee3f64b9 Add q as a debug statement
q is a debugging tool: https://pypi.python.org/pypi/q
2015-04-10 10:55:33 -07:00
Anthony Sottile 15b678e9c6 Merge pull request #49 from pre-commit/only_check_merge_conflicted_files
Only check merge conflicts on conflict commits
2015-03-21 14:04:37 -07:00
Anthony Sottile 635fa7dd9d Only check merge conflicts on conflict commits 2015-03-20 16:21:02 -07:00
Anthony Sottile 34444ba2c7 Merge pull request #48 from pre-commit/no_more_plumbum
Remove dependency on plumbum
2015-03-20 14:30:56 -07:00