summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndi Albrecht <albrecht.andi@gmail.com>2015-12-14 19:18:26 +0100
committerAndi Albrecht <albrecht.andi@gmail.com>2015-12-14 19:18:26 +0100
commit38a14896e503d0946e622931923fb1350fa29ffd (patch)
tree51448877610a28fe158cce7ac6635a842ed428d7
parentac3fdfd2714b275e6def5ec2cf8bf92cabe56b60 (diff)
downloadsqlparse-38a14896e503d0946e622931923fb1350fa29ffd.tar.gz
Add test case for issue 214, update changelog and authors.
-rw-r--r--AUTHORS1
-rw-r--r--CHANGES4
-rw-r--r--tests/test_regressions.py5
3 files changed, 10 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS
index 04e5f09..85ca1f0 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -26,6 +26,7 @@ Alphabetical list of contributors:
* Robert Nix <com.github@rnix.org>
* Rocky Meza <rmeza@fusionbox.com>
* Ryan Wooden <rygwdn@gmail.com>
+* Shen Longxing <shenlongxing2012@gmail.com>
* spigwitmer <itgpmc@gmail.com>
* Tim Graham <timograham@gmail.com>
* Victor Hahn <info@victor-hahn.de>
diff --git a/CHANGES b/CHANGES
index 48f757c..08015c9 100644
--- a/CHANGES
+++ b/CHANGES
@@ -9,6 +9,10 @@ Internal Changes
sqlparse.exceptions.
* sqlparse.sql.Token.to_unicode was removed.
+Bug Fixes
+* Leading whitespaces are now removed when format() is called with
+ strip_whitespace=True (issue213, by shenlongxing).
+
Release 0.1.18 (Oct 25, 2015)
-----------------------------
diff --git a/tests/test_regressions.py b/tests/test_regressions.py
index 50592c5..ca7dd5b 100644
--- a/tests/test_regressions.py
+++ b/tests/test_regressions.py
@@ -286,3 +286,8 @@ def test_issue212_py2unicode():
t2 = sql.Token(T.String, u"bug")
l = sql.TokenList([t1, t2])
assert str(l) == 'schöner bug'
+
+
+def test_issue213_leadingws():
+ sql = " select * from foo"
+ assert sqlparse.format(sql, strip_whitespace=True) == "select * from foo"