Skip to content

Commit 8ca3612

Browse files
spelling fixes (#146)
* codespell fixes * fix delimiter spelling in function name * resolve 'splitted' typo Co-authored-by: Adrian Szadkowski <adrian.szadkowski@zebra.com>
1 parent f212afd commit 8ca3612

20 files changed

+48
-48
lines changed

CHANGES.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
### Features
4646
- New option ``--configure`` or ``-c`` for configuring transformer parameters. It works the same way configuring through ``--transform`` works. The benefit of using ``--configure`` is that you can configure selected transformers and still run all transformers [#96](https://github.com/MarketSquare/robotframework-tidy/issues/96)
47-
- Transformers can now be disabled by default if you add ``ENABLED = False`` class attribute to your class. Those transformers will be only run when selected explictly with ``--transform`` option [#10](https://github.com/MarketSquare/robotframework-tidy/issues/10)
47+
- Transformers can now be disabled by default if you add ``ENABLED = False`` class attribute to your class. Those transformers will be only run when selected explicitly with ``--transform`` option [#10](https://github.com/MarketSquare/robotframework-tidy/issues/10)
4848
- Support for ``pyproject.toml`` configuration files. Because of the required changes there are backward incompatible changes done to ``robotidy.toml`` syntax. See example from [README](https://github.com/MarketSquare/robotframework-tidy/blob/main/README.rst#configuration-file) [#66](https://github.com/MarketSquare/robotframework-tidy/issues/66)
4949
- ``--list-transformers`` output is now ordered. Also transformers themselves will always run in the same predefined order [#69](https://github.com/MarketSquare/robotframework-tidy/issues/69)
5050
- ``--describe-transformer`` output is now pre-formatted (removed rst formatting) [#83](https://github.com/MarketSquare/robotframework-tidy/issues/83)
@@ -85,7 +85,7 @@
8585
### Transformers
8686

8787
- DiscardEmptySections - empty sections are removed
88-
- SplitTooLongLine - keywords with too long lines are splitted
88+
- SplitTooLongLine - keywords with too long lines are split
8989
- NormalizeSettingName - ensure that setting names are Title Case - Test Template, Library
9090
- AssignmentNormalizer - use only one type of assignment
9191
- NormalizeNewLines - ensure proper number of empty lines between keywords, test cases and sections

docs/source/configuration/configuring_transformers.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Configuring Transformers
44
========================
55

6-
Transformers can be configured through two diffrent options: ``--transform`` and ``--configure``. They share the same
6+
Transformers can be configured through two different options: ``--transform`` and ``--configure``. They share the same
77
syntax for parameter names and values. The main difference is that ``--transform`` is also used to select what
88
transformers will be used. For example::
99

docs/source/transformers/ReplaceRunKeywordIf.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Any return value will be applied to every ELSE/ELSE IF branch.
4545
${var} Keyword2
4646
END
4747

48-
Run Keywords inside Run Keyword If will be splitted into separate keywords.
48+
Run Keywords inside Run Keyword If will be split into separate keywords.
4949

5050
.. tabs::
5151

docs/source/transformers/SmartSortKeywords.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ SmartSortKeywords is not included in default transformers that's why you need to
99

1010
robotidy --transform SmartSortKeywords src
1111

12-
By default sorting is case insensitve, but keywords with leading underscore go to the bottom. Other underscores are
12+
By default sorting is case insensitive, but keywords with leading underscore go to the bottom. Other underscores are
1313
treated as spaces.
1414
Empty lines (or lack of them) between keywords are preserved.
1515

robotidy/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def print_description(name: str):
190190
def print_transformers_list():
191191
transformers = load_transformers(None, {}, allow_disabled=True)
192192
click.echo('To see detailed docs run --desc <transformer_name> or --desc all. '
193-
'Transformers with (disabled) tag \nare executed only when selected explictly with --transform. '
193+
'Transformers with (disabled) tag \nare executed only when selected explicitly with --transform. '
194194
'Available transformers:\n')
195195
transformer_names = []
196196
for transformer in transformers:

robotidy/transformers/MergeAndOrderSections.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def parse_order(order):
5656
)
5757
if not order:
5858
return default_order
59-
splitted = order.lower().split(',')
59+
parts = order.lower().split(',')
6060
map = {
6161
'comments': Token.COMMENT_HEADER,
6262
'comment': Token.COMMENT_HEADER,
@@ -70,8 +70,8 @@ def parse_order(order):
7070
'keyword': Token.KEYWORD_HEADER
7171
}
7272
parsed_order = []
73-
for split in splitted:
74-
parsed_order.append(map.get(split, None))
73+
for part in parts:
74+
parsed_order.append(map.get(part, None))
7575
if any(header not in parsed_order for header in default_order) and len(parsed_order) != len(default_order):
7676
raise click.BadOptionUsage(
7777
option_name='transform',

robotidy/transformers/NormalizeSeparators.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@ def parse_sections(sections):
3838
return default
3939
if not sections:
4040
return {}
41-
splitted = sections.split(',')
41+
parts = sections.split(',')
4242
parsed_sections = set()
43-
for split in splitted:
44-
split = split.replace('_', '')
45-
if split and split[-1] != 's':
46-
split += 's'
47-
if split not in default:
43+
for part in parts:
44+
part = part.replace('_', '')
45+
if part and part[-1] != 's':
46+
part += 's'
47+
if part not in default:
4848
raise click.BadOptionUsage(
4949
option_name='transform',
5050
message=f"Invalid configurable value: '{sections}' for sections for NormalizeSeparators transformer."
5151
f" Sections to be transformed should be provided in comma separated list with valid section"
5252
f" names:\n{sorted(default)}")
53-
parsed_sections.add(split)
53+
parsed_sections.add(part)
5454
return parsed_sections
5555

5656
def visit_File(self, node): # noqa

robotidy/transformers/OrderSettings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ def get_order(order, default, name_map):
7878
return default
7979
if not order:
8080
return []
81-
splitted = order.lower().split(',')
81+
parts = order.lower().split(',')
8282
try:
83-
return [name_map[split] for split in splitted]
83+
return [name_map[part] for part in parts]
8484
except KeyError:
8585
raise click.BadOptionUsage(
8686
option_name='transform',

robotidy/transformers/OrderSettingsSection.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,24 +108,24 @@ def parse_group_order(order):
108108
return default
109109
if not order:
110110
return []
111-
splitted = order.lower().split(',')
112-
if any(split not in default for split in splitted):
111+
parts = order.lower().split(',')
112+
if any(part not in default for part in parts):
113113
raise click.BadOptionUsage(
114114
option_name='transform',
115115
message=f"Invalid configurable value: '{order}' for group_order for OrderSettingsSection transformer."
116116
f" Custom order should be provided in comma separated list with valid group names:\n{default}"
117117
)
118-
return splitted
118+
return parts
119119

120120
@staticmethod
121121
def parse_order_in_group(order, default, mapping):
122122
if order is None:
123123
return default
124124
if not order:
125125
return []
126-
splitted = order.lower().split(',')
126+
parts = order.lower().split(',')
127127
try:
128-
return [mapping[split] for split in splitted]
128+
return [mapping[part] for part in parts]
129129
except KeyError:
130130
raise click.BadOptionUsage(
131131
option_name='transform',

robotidy/transformers/ReplaceRunKeywordIf.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class ReplaceRunKeywordIf(ModelTransformer):
5454
${var} Keyword2
5555
END
5656
57-
Run Keywords inside Run Keyword If will be splitted into separate keywords::
57+
Run Keywords inside Run Keyword If will be split into separate keywords::
5858
5959
Run Keyword If ${condition} Run Keywords Keyword ${arg} AND Keyword2
6060
@@ -87,7 +87,7 @@ def create_branched(self, node):
8787
Token(Token.EOL)
8888
])
8989
prev_if = None
90-
for branch in reversed(list(self.split_args_on_delimeters(raw_args, ('ELSE', 'ELSE IF'), assign=assign))):
90+
for branch in reversed(list(self.split_args_on_delimiters(raw_args, ('ELSE', 'ELSE IF'), assign=assign))):
9191
if branch[0].value == 'ELSE':
9292
header = ElseHeader([
9393
separator,
@@ -128,7 +128,7 @@ def create_branched(self, node):
128128
def create_keywords(self, arg_tokens, assign, indent):
129129
if normalize_name(arg_tokens[0].value) == 'runkeywords':
130130
return [self.args_to_keyword(keyword[1:], assign, indent)
131-
for keyword in self.split_args_on_delimeters(arg_tokens, ('AND',))]
131+
for keyword in self.split_args_on_delimiters(arg_tokens, ('AND',))]
132132
return self.args_to_keyword(arg_tokens, assign, indent)
133133

134134
def args_to_keyword(self, arg_tokens, assign, indent):
@@ -140,13 +140,13 @@ def args_to_keyword(self, arg_tokens, assign, indent):
140140
return KeywordCall.from_tokens(separated_tokens)
141141

142142
@staticmethod
143-
def split_args_on_delimeters(args, delimeters, assign=None):
144-
split_points = [index for index, arg in enumerate(args) if arg.value in delimeters]
143+
def split_args_on_delimiters(args, delimiters, assign=None):
144+
split_points = [index for index, arg in enumerate(args) if arg.value in delimiters]
145145
prev_index = 0
146146
for split_point in split_points:
147147
yield args[prev_index:split_point]
148148
prev_index = split_point
149149
yield args[prev_index:len(args)]
150-
if assign and 'ELSE' in delimeters and not any(arg.value == 'ELSE' for arg in args):
150+
if assign and 'ELSE' in delimiters and not any(arg.value == 'ELSE' for arg in args):
151151
values = [Token(Token.ARGUMENT, '${None}')] * len(assign)
152152
yield [Token(Token.ELSE), Token(Token.ARGUMENT, 'Set Variable'), *values]

0 commit comments

Comments
 (0)