Skip to content

Commit 43478c6

Browse files
committed
Fix typos
1 parent 745df45 commit 43478c6

12 files changed

Lines changed: 24 additions & 24 deletions

File tree

sqlparse/engine/grouping.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ def _group_matching(tlist, cls):
2828
continue
2929

3030
if token.is_group and not isinstance(token, cls):
31-
# Check inside previously grouped (ie. parenthesis) if group
32-
# of differnt type is inside (ie, case). though ideally should
31+
# Check inside previously grouped (i.e. parenthesis) if group
32+
# of different type is inside (i.e., case). though ideally should
3333
# should check for all open/close tokens at once to avoid recursion
3434
_group_matching(token, cls)
3535
continue
@@ -365,7 +365,7 @@ def _group(tlist, cls, match,
365365
extend=True,
366366
recurse=True
367367
):
368-
"""Groups together tokens that are joined by a middle token. ie. x < y"""
368+
"""Groups together tokens that are joined by a middle token. i.e. x < y"""
369369

370370
tidx_offset = 0
371371
pidx, prev_ = None, None

sqlparse/engine/statement_splitter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def _change_splitlevel(self, ttype, value):
2929
# ANSI
3030
# if normal token return
3131
# wouldn't parenthesis increase/decrease a level?
32-
# no, inside a paranthesis can't start new statement
32+
# no, inside a parenthesis can't start new statement
3333
if ttype not in T.Keyword:
3434
return 0
3535

@@ -56,9 +56,9 @@ def _change_splitlevel(self, ttype, value):
5656
return 1
5757
return 0
5858

59-
# Should this respect a preceeding BEGIN?
59+
# Should this respect a preceding BEGIN?
6060
# In CASE ... WHEN ... END this results in a split level -1.
61-
# Would having multiple CASE WHEN END and a Assigment Operator
61+
# Would having multiple CASE WHEN END and a Assignment Operator
6262
# cause the statement to cut off prematurely?
6363
if unified == 'END':
6464
self._begin_depth = max(0, self._begin_depth - 1)

sqlparse/filters/aligned_indent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def __init__(self, char=' ', n='\n'):
3131
def nl(self, offset=1):
3232
# offset = 1 represent a single space after SELECT
3333
offset = -len(offset) if not isinstance(offset, int) else offset
34-
# add two for the space and parens
34+
# add two for the space and parenthesis
3535
indent = self.indent * (2 + self._max_kwd_len)
3636

3737
return sql.Token(T.Whitespace, self.n + self.char * (
@@ -50,7 +50,7 @@ def _process_parenthesis(self, tlist):
5050
if token is not None:
5151
with indent(self):
5252
tlist.insert_after(tlist[0], self.nl('SELECT'))
53-
# process the inside of the parantheses
53+
# process the inside of the parenthesis
5454
self._process_default(tlist)
5555

5656
# de-indent last parenthesis

sqlparse/filters/output.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def process(self, stmt):
3333

3434
class OutputPythonFilter(OutputFilter):
3535
def _process(self, stream, varname, has_nl):
36-
# SQL query asignation to varname
36+
# SQL query assignation to varname
3737
if self.count > 1:
3838
yield sql.Token(T.Whitespace, '\n')
3939
yield sql.Token(T.Name, varname)
@@ -79,7 +79,7 @@ class OutputPHPFilter(OutputFilter):
7979
varname_prefix = '$'
8080

8181
def _process(self, stream, varname, has_nl):
82-
# SQL query asignation to varname (quote header)
82+
# SQL query assignation to varname (quote header)
8383
if self.count > 1:
8484
yield sql.Token(T.Whitespace, '\n')
8585
yield sql.Token(T.Name, varname)

sqlparse/keywords.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def is_keyword(value):
4545
# FIXME(andi): VALUES shouldn't be listed here
4646
# see https://github.com/andialbrecht/sqlparse/pull/64
4747
# IN is special, it may be followed by a parenthesis, but
48-
# is never a functino, see issue183
48+
# is never a function, see issue183
4949
(r'(CASE|IN|VALUES|USING)\b', tokens.Keyword),
5050

5151
(r'(@|##|#)[A-ZÀ-Ü]\w+', tokens.Name),
@@ -55,7 +55,7 @@ def is_keyword(value):
5555
# TODO: Spaces before period not implemented
5656
(r'[A-ZÀ-Ü]\w*(?=\s*\.)', tokens.Name), # 'Name' .
5757
# FIXME(atronah): never match,
58-
# because `re.match` doesn't work with lookbehind regexp feature
58+
# because `re.match` doesn't work with look-behind regexp feature
5959
(r'(?<=\.)[A-ZÀ-Ü]\w*', tokens.Name), # .'Name'
6060
(r'[A-ZÀ-Ü]\w*(?=\()', tokens.Name), # side effect: change kw to func
6161
(r'-?0x[\dA-F]+', tokens.Number.Hexadecimal),

sqlparse/lexer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def get_tokens(text, encoding=None):
3535
3636
Split ``text`` into (tokentype, text) pairs.
3737
38-
``stack`` is the inital stack (default: ``['root']``)
38+
``stack`` is the initial stack (default: ``['root']``)
3939
"""
4040
if isinstance(text, file_types):
4141
text = text.read()

sqlparse/sql.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Token(object):
2020
"""Base class for all other classes in this module.
2121
2222
It represents a single token and has two instance attributes:
23-
``value`` is the unchange value of the token and ``ttype`` is
23+
``value`` is the unchanged value of the token and ``ttype`` is
2424
the type of the token.
2525
"""
2626

@@ -73,7 +73,7 @@ def match(self, ttype, values, regex=False):
7373
*values* is a list of possible values for this token. The values
7474
are OR'ed together so if only one of the values matches ``True``
7575
is returned. Except for keyword tokens the comparison is
76-
case-sensitive. For convenience it's ok to pass in a single string.
76+
case-sensitive. For convenience it's OK to pass in a single string.
7777
If *regex* is ``True`` (default is ``False``) the given values are
7878
treated as regular expressions.
7979
"""
@@ -363,7 +363,7 @@ def get_real_name(self):
363363
def get_parent_name(self):
364364
"""Return name of the parent object if any.
365365
366-
A parent object is identified by the first occuring dot.
366+
A parent object is identified by the first occurring dot.
367367
"""
368368
dot_idx, _ = self.token_next_by(m=(T.Punctuation, '.'))
369369
_, prev_ = self.token_prev(dot_idx)

sqlparse/tokens.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def __getattr__(self, name):
2525
return new
2626

2727
def __repr__(self):
28-
# self can be False only if its the `root` ie. Token itself
28+
# self can be False only if its the `root` i.e. Token itself
2929
return 'Token' + ('.' if self else '') + '.'.join(self)
3030

3131

@@ -55,7 +55,7 @@ def __repr__(self):
5555
# Generic types for non-source code
5656
Generic = Token.Generic
5757

58-
# String and some others are not direct childs of Token.
58+
# String and some others are not direct children of Token.
5959
# alias them:
6060
Token.Token = Token
6161
Token.String = String

tests/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def filepath():
1717

1818
def make_filepath(filename):
1919
# http://stackoverflow.com/questions/18011902/parameter-to-a-fixture
20-
# Alternate solution is to use paramtrization `inderect=True`
20+
# Alternate solution is to use parametrization `indirect=True`
2121
# http://stackoverflow.com/a/33879151
2222
# Syntax is noisy and requires specific variable names
2323
return os.path.join(FILES_DIR, filename)
@@ -31,7 +31,7 @@ def load_file(filepath):
3131

3232
def make_load_file(filename, encoding='utf-8'):
3333
# http://stackoverflow.com/questions/18011902/parameter-to-a-fixture
34-
# Alternate solution is to use paramtrization `inderect=True`
34+
# Alternate solution is to use parametrization `indirect=True`
3535
# http://stackoverflow.com/a/33879151
3636
# Syntax is noisy and requires specific variable names
3737
# And seems to be limited to only 1 argument.

tests/test_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def test_valid_args(filepath):
3535
def test_invalid_choise(filepath):
3636
path = filepath('function.sql')
3737
with pytest.raises(SystemExit):
38-
sqlparse.cli.main([path, '-l', 'spanish'])
38+
sqlparse.cli.main([path, '-l', 'Spanish'])
3939

4040

4141
def test_invalid_args(filepath, capsys):

0 commit comments

Comments
 (0)