hhatto/autopep8 — pull request #181 by schlamar (2014-11-18 08:50:08+00:00)
Title: Fix exclude in recursive mode

find_files did match files and subdirectories from excluded directory in recursive mode.

E.g. if running `autopep8 -i -r --exclude dir/excluded dir/` files from `dir/excluded/` and `dir/excluded/subdir/` were still taken in account.

BTW, there are 5 tests failing, but these are not related to my changes. I get the same failures without my commit.

======================================================================
FAIL: test_diff (__main__.CommandLineTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test\test_autopep8.py", line 4245, in test_diff
self.assertEqual(fixed, '\n'.join(result.split('\n')[3:]))
AssertionError: u"-'abc' \n+'abc'\n" != u"-'abc' \r\n+'abc'\r\n"
- -'abc'
+ -'abc'
? +
- +'abc'
+ +'abc'
? +

======================================================================
FAIL: test_pep8_ignore (__main__.CommandLineTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test\test_autopep8.py", line 4272, in test_pep8_ignore
self.assertEqual(line, result)
AssertionError: u"'abc' \n" != u"'abc' \r\n"
- 'abc'
+ 'abc'
? +

======================================================================
FAIL: test_pep8_ignore_should_handle_trailing_comma_gracefully (__main__.CommandLineTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test\test_autopep8.py", line 4278, in test_pep8_ignore_should_handle_trailing_comma_gracefully
self.assertEqual(fixed, result)
AssertionError: u"'abc'\n" != u"'abc'\r\n"
- 'abc'
+ 'abc'
? +

======================================================================
FAIL: test_pep8_passes (__main__.CommandLineTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test\test_autopep8.py", line 4267, in test_pep8_passes
self.assertEqual(fixed, result)
AssertionError: u"'abc'\n" != u"'abc'\r\n"
- 'abc'
+ 'abc'
? +

======================================================================
FAIL: test_recursive (__main__.CommandLineTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test\test_autopep8.py", line 4384, in test_recursive
'\n'.join(result.split('\n')[3:5]))
AssertionError: u"-'abc' \n+'abc'" != u"-'abc' \r\n+'abc'\r"
- -'abc'
+ -'abc'
? +
? + +'abc'

----------------------------------------------------------------------
Ran 472 tests in 23.736s

FAILED (failures=5)