summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.txt8
-rw-r--r--docs/conf.py9
-rw-r--r--docs/index.rst2
-rwxr-xr-xpep8.py6
-rw-r--r--testsuite/test_all.py3
-rw-r--r--testsuite/test_util.py23
6 files changed, 44 insertions, 7 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 4bcfcf7..a178e6c 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -5,6 +5,12 @@ Changelog
1.x (unreleased)
----------------
+News:
+
+* Ian Lee <ianlee1521@gmail.com> joined the project as a maintainer.
+
+Bug fixes:
+
* Report E731 for lambda assignment. (Issue #277)
* Report E704 for one-liner def instead of E701.
@@ -16,6 +22,8 @@ Changelog
* Report E266 instead of E265 when the block comment starts with
multiple ``#``. (Issue #270)
+* Strip whitespace from around paths during normalization. (Issue #339 / #343)
+
1.5.7 (2014-05-29)
------------------
diff --git a/docs/conf.py b/docs/conf.py
index cd288cc..d1dca3c 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -45,7 +45,8 @@ master_doc = 'index'
# General information about the project.
project = u'pep8'
-copyright = u'2012-2013, Florent Xicluna'
+authors = u'Johann C. Rocholl, Florent Xicluna, Ian Lee'
+copyright = u'2006-2014, %s' % (authors)
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
@@ -192,7 +193,7 @@ latex_elements = {
# author, documentclass [howto/manual]).
latex_documents = [
('index', 'pep8.tex', u'pep8 documentation',
- u'Florent Xicluna', 'manual'),
+ authors, 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
@@ -222,7 +223,7 @@ latex_documents = [
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'pep8', u'pep8 documentation',
- [u'Florent Xicluna'], 1)
+ [authors], 1)
]
# If true, show URL addresses after external links.
@@ -235,7 +236,7 @@ man_pages = [
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
- ('index', 'pep8', u'pep8 documentation', u'Florent Xicluna',
+ ('index', 'pep8', u'pep8 documentation', authors,
'pep8', 'One line description of project.',
'Miscellaneous'),
]
diff --git a/docs/index.rst b/docs/index.rst
index eb3f21a..5500e0d 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -37,7 +37,7 @@ Credits
Created by Johann C. Rocholl.
-Maintained by Florent Xicluna.
+Maintained by Florent Xicluna and Ian Lee.
.. _license:
diff --git a/pep8.py b/pep8.py
index b31a978..d638388 100755
--- a/pep8.py
+++ b/pep8.py
@@ -2,6 +2,7 @@
# pep8.py - Check Python source code formatting, according to PEP 8
# Copyright (C) 2006-2009 Johann C. Rocholl <johann@rocholl.net>
# Copyright (C) 2009-2014 Florent Xicluna <florent.xicluna@gmail.com>
+# Copyright (C) 2014 Ian Lee <ianlee1521@gmail.com>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
@@ -1155,10 +1156,13 @@ def normalize_paths(value, parent=os.curdir):
Return a list of absolute paths.
"""
- if not value or isinstance(value, list):
+ if not value:
+ return []
+ if isinstance(value, list):
return value
paths = []
for path in value.split(','):
+ path = path.strip()
if '/' in path:
path = os.path.abspath(os.path.join(parent, path))
paths.append(path.rstrip('/'))
diff --git a/testsuite/test_all.py b/testsuite/test_all.py
index 5160900..50e2cb9 100644
--- a/testsuite/test_all.py
+++ b/testsuite/test_all.py
@@ -46,12 +46,13 @@ class Pep8TestCase(unittest.TestCase):
def suite():
- from testsuite import test_api, test_shell
+ from testsuite import test_api, test_shell, test_util
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(Pep8TestCase))
suite.addTest(unittest.makeSuite(test_api.APITestCase))
suite.addTest(unittest.makeSuite(test_shell.ShellTestCase))
+ suite.addTest(unittest.makeSuite(test_util.UtilTestCase))
return suite
diff --git a/testsuite/test_util.py b/testsuite/test_util.py
new file mode 100644
index 0000000..658d057
--- /dev/null
+++ b/testsuite/test_util.py
@@ -0,0 +1,23 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+import os
+import unittest
+
+import pep8
+
+
+class UtilTestCase(unittest.TestCase):
+ def test_normalize_paths(self):
+ cwd = os.getcwd()
+
+ self.assertEquals(pep8.normalize_paths(''), [])
+ self.assertEquals(pep8.normalize_paths([]), [])
+ self.assertEquals(pep8.normalize_paths(None), [])
+ self.assertEquals(pep8.normalize_paths(['foo']), ['foo'])
+ self.assertEquals(pep8.normalize_paths('foo'), ['foo'])
+ self.assertEquals(pep8.normalize_paths('foo,bar'), ['foo', 'bar'])
+ self.assertEquals(pep8.normalize_paths('foo, bar '), ['foo', 'bar'])
+ self.assertEquals(pep8.normalize_paths('/foo/bar,baz/../bat'),
+ ['/foo/bar', cwd + '/bat'])
+ self.assertEquals(pep8.normalize_paths(".pyc,\n build/*"),
+ ['.pyc', cwd + '/build/*'])