summaryrefslogtreecommitdiff
path: root/flake8/hooks.py
Commit message (Collapse)AuthorAgeFilesLines
* Move flake8 2 out of the wayIan Cordasco2016-03-151-297/+0
|
* Isolate the commands that raise OSErrorIan Cordasco2015-12-171-4/+6
| | | | | | | Right now, running the git and hg commands could easily raise an OSError. Let's only catch it in those cases and then use else to install hooks when those are successful. Otherwise, pass on to the next supported VCS
* Fix checking for repo dir without git/hgadammhaile2015-12-161-9/+15
|
* Change the git-hook ignore default to Nonebug/52Ian Cordasco2015-04-051-1/+1
| | | | | | | | When ignore is an empty string, it will apparently not run any checks at all. Using None as the default ensures that it does run the appropriate checks. Closes #52
* Add compatibility layer for Python 2.6Ian Cordasco2015-03-061-1/+2
| | | | | | | os.path.relpath on Python 2.6 returns slightly different output than it does on 2.7. Rather than try to write tests around the behaviour, it makes sense to have a common relpath function that behaves the same on every version.
* Merge branch 'local/pr/2'Ian Cordasco2015-03-061-13/+9
|\ | | | | | | | | Conflicts: flake8/hooks.py
| * Simplify @mpenkov's fix for exclude in git hooksIan Cordasco2015-03-061-14/+9
| | | | | | | | | | | | | | | | | | The simpler fix is to ensure that the filename isn't the full path to the temporary file before we check to see if it should be excluded or if it should even match. This also fixes a bug I found while testing the pull request in which no files are checked.
* | Merge remote-tracking branch 'origin/gh/2'Ian Cordasco2015-03-061-1/+7
|\ \
| * | WIPmpenkov-masterIan Cordasco2015-03-061-6/+5
| |/
| * Adding unit tests for fix in 218949aMichael Penkov2015-02-071-7/+6
| |
| * Correctly handle exclude patterns in git_hookMichael Penkov2014-11-111-1/+9
| |
* | Refactor some bits of flake8.hooksIan Cordasco2015-02-221-20/+27
| |
* | Use git config before os.environOleg Broytman2015-02-161-7/+40
| | | | | | | | Get parameter's value using git config before trying os.environ.
* | Minor refactoringOleg Broytman2015-02-161-4/+3
|/
* Honor file pattern matching for git hookChris Buccella2014-09-231-3/+8
| | | | | | In a config file, a user can use the "filename" option to specify a pattern for matching filenames. The git hook effectively ignores this and only checks files ending in '.py'
* Do not overwrite Git pre-commit hook; closes #149Florent Xicluna2014-05-051-0/+2
|
* Use write-only mode 'w' instead of 'w+' for writing hooksFlorent Xicluna2014-05-051-3/+4
|
* Assume UTF-8 when decoding hg or git output; closes #148Florent Xicluna2014-05-051-2/+2
|
* Merged in fr710/flake8 (pull request #41)Florent Xicluna2014-03-301-10/+5
|\ | | | | | | Fix Git and Mercurial hooks if no config files are present
| * Minor hg hook refactoringFlorian Rathgeber2014-03-231-3/+1
| |
| * Pass current directory as paths to pep8 StyleGuideFlorian Rathgeber2014-03-231-6/+3
| | | | | | | | | | | | | | | | | | Instead of setting parse_argv to True, which fails if no config files are present, we pass the current directory as the paths keyword argument when creating the pep8 StyleGuide. This causes pep8 to parse local config files as expected and works also if none are present. Requires pep8 68d72a5d or newer.
| * Default hg ignore config to empty instead of NoneFlorian Rathgeber2014-03-231-1/+1
| | | | | | | | | | | | Setting it to None is interpreted as the string 'None', which does the wrong thing. Setting it to the empty string gives the right behaviour and allows overriding in config files.
* | Disable mercurial demandimport in _pyflakes moduleFlorian Rathgeber2014-03-231-6/+0
|/ | | | | | | Disabling in hooks is too late since mercurial already imports _pyflakes before. Fixes #88
* Git and Mercurial hooks respect FLAKE8_LAZYFlorian Rathgeber2013-10-261-1/+10
|
* Git and Mercurial hooks respect FLAKE8_IGNOREFlorian Rathgeber2013-10-261-1/+5
|
* Git hook respects local configuration filesFlorian Rathgeber2013-10-261-3/+24
| | | | | | If none of the Git hook default parameters are overridden, do not pass them in to the StyleGuide to not override the local configuration.
* Bugfix: get the parser if no vcs found in install_hookFlorian Rathgeber2013-09-141-7/+9
|
* revert checking for string and just pass a string to run() instead of a listTobias Megies2013-10-101-4/+2
|
* bugfix: shift a line into loopTobias Megies2013-10-101-1/+1
|
* remove encoding/decoding of staged filesTobias Megies2013-10-101-23/+4
|
* git hook: try to encode/decode with correct encoding (try to detect from ↵Tobias Megies2013-10-091-5/+27
| | | | file header)
* make git_hook check staged versions of files instead of local versionTobias Megies2013-10-081-7/+37
| | | | | copies all staged versions of files to check in a temporary folder and runs checks on this folder.
* Fix hook file permissionsLaurent Bachelier2013-07-141-4/+3
| | | | | On my system (Python 2.7), I would end up with "--wxr-x--T". This solution should work everywhere.
* Fix git hook on python 3Ian Cordasco2013-07-041-0/+8
| | | | | We were expecting strings not bytearrays and so we'll make sure we get strings. And yes, unicode strings work just fine with this on python 2.
* Update hooks.pyRob Hudson2013-04-021-1/+1
| | | | Added --diff-filter to ignore deleted files.
* Merged in develop (pull request #35)Ian Cordasco2013-04-011-0/+6
|\ | | | | | | Fix mercurial hook, issue #88
| * Fix mercurial hook, issue #88Florent Xicluna2013-02-261-0/+6
| |
* | Yay I can't type any moreIan Cordasco2013-03-241-1/+1
| |
* | Silly python 2.5 binary is for kidsIan Cordasco2013-03-241-1/+3
| |
* | Fix #91 (bitbucket)Ian Cordasco2013-03-241-2/+7
| | | | | | | | | | | | | | Non python files were being included in the git hook. Also, I realized that with --install-hook on git projects, the file was not readable to the user. Using binary helps clarify the use of chmod since I had erroneously used the 744 like the commandline does.
* | Update the VCS docsIan Cordasco2013-02-261-0/+3
| | | | | | | | | | Also, update the git_hook auto-installer text. Fixes #87 on BitBucket
* | Fixes #86 on bitbucketIan Cordasco2013-02-251-0/+4
|/ | | | Create hgrc if it doesn't exist.
* Fix spaceFlorent Xicluna2013-02-251-1/+1
|
* Add docsIan Cordasco2013-02-221-0/+17
|
* Restore the whole-file-skip featureFlorent Xicluna2013-02-201-2/+1
|
* Small refactoring in the hooks moduleFlorent Xicluna2013-02-201-16/+11
|
* Wrong exit code for the VCS hooksFlorent Xicluna2013-02-131-2/+2
|
* Fix the commit hooks, hopefullyFlorent Xicluna2013-02-131-24/+24
|
* Add support for the pep8 config fileKevin Stanton2013-01-091-1/+2
| | | | Closes #55.
* Mention changes in preparation for 2.0.0Ian Cordasco2013-01-021-1/+65
| | | | Working version of --install-hook.