Commit graph

154 commits

Author SHA1 Message Date
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
Anthony Sottile
713fab4bc7 Remove dependency on plumbum 2015-03-20 14:15:30 -07:00
Anthony Sottile
c9b6161fab Merge pull request #47 from guykisel/merge-conflict-hook
Add check-merge-conflict hook
2015-03-13 17:50:47 -06:00
Guy Kisel
86d8446800 Fix off by one error in line number enumeration 2015-03-13 16:32:21 -07:00
Guy Kisel
779a42919a Add check-merge-conflict hook 2015-03-13 16:30:14 -07:00
Anthony Sottile
70a319aea3 Merge pull request #46 from guykisel/django-test-hook
Add --django flag to test name checker
2015-03-11 20:28:49 -06:00
Guy Kisel
db4b8f02f3 Add --django flag to test name checker 2015-03-11 17:44:59 -07:00
Anthony Sottile
9ce45609a9 Merge pull request #43 from campaul/detect_private_key
Detect OpenSSH private keys
2015-03-08 12:38:35 -07:00
Anthony Sottile
4cb861acec v0.4.1 2015-03-08 12:32:40 -07:00
Anthony Sottile
686d486791 Bump to latest hooks 2015-03-08 11:34:33 -07:00
Anthony Sottile
4078cbedf0 Quickfix to prevent pep8 conflicts 2015-03-08 11:34:04 -07:00
Cameron Paul
68a7729327 Detect OpenSSH private keys 2015-03-07 09:35:30 -08:00
Anthony Sottile
9d1ac3273b Update README.md 2015-02-27 07:58:59 -08:00
Ken Struys
fc8b97e4ab Merge pull request #39 from pre-commit/autopep8_via_config
Respect autopep8 config.  Resolves #38.
2015-02-26 19:33:40 -08:00
Anthony Sottile
d96cef92c9 Respect autopep8 config. Resolves #38. 2015-02-26 18:23:52 -08:00
Anthony Sottile
9f107a0327 v0.4.0 2015-02-22 08:39:33 -08:00
Anthony Sottile
c4c3c735fd Merge pull request #36 from pre-commit/more_natural_sort_requirements
More naturally sort requirements.
2015-02-12 09:41:57 -08:00
Anthony Sottile
151d485a81 More naturally sort requirements. 2015-02-12 09:30:17 -08:00
Ken Struys
a4ba3ca567 Merge pull request #35 from pre-commit/use_tokenizer_for_string_fixer
Use the tokenizer for great success
2015-02-10 10:28:30 -08:00
Anthony Sottile
2983d4478f Use the tokenizer for great success 2015-02-10 08:17:35 -08:00
Anthony Sottile
5207d1f29a Merge pull request #34 from struys/string_fixer
implemented a basic double quote string fixer
2015-02-09 10:13:57 -08:00
Ken Struys
fed386438e Merge pull request #1 from pre-commit/meybs_fixey_fixey
Simplify string-fixer
2015-02-09 09:58:59 -08:00
Anthony Sottile
9326fad9c8 Simplify string-fixer 2015-02-09 09:45:58 -08:00
Ken Struys
12f02dfeb8 implemented a basic double quote string fixer 2015-02-08 21:05:12 -08:00
Anthony Sottile
5fe82b3a37 Update README.md 2015-01-19 18:06:06 -08:00
Anthony Sottile
6bd93dca39 Merge pull request #33 from pre-commit/appveyor
Add appveyor
2015-01-19 17:42:00 -08:00
Anthony Sottile
e70a83fbd6 Add appveyor 2015-01-19 17:19:03 -08:00
Anthony Sottile
e39cfdf454 Merge pull request #32 from pre-commit/windows_support
Fix end-of-file-fixer on windows
2015-01-19 16:47:03 -08:00
Anthony Sottile
dd9a07daf1 Fix end-of-file-fixer on windows 2015-01-19 16:43:10 -08:00
Anthony Sottile
375913d017 Merge pull request #31 from pre-commit/readme_test
Add test for readme
2015-01-18 09:55:55 -08:00
Anthony Sottile
a8b89150ff Add test for readme 2015-01-18 09:48:14 -08:00
Anthony Sottile
144e6a931e Merge pull request #30 from pre-commit/check-xml
Add check-xml hook.
2015-01-17 10:39:10 -08:00