Skip to content

Commit e16e742

Browse files
authored
Drop unnecessary scope qualifiers to please flake8 (#47)
These variables are not assigned to, and so the scope qualifiers are not necessary and may be misleading.
1 parent 81b154d commit e16e742

4 files changed

Lines changed: 0 additions & 7 deletions

File tree

colcon_mixin/mixin/mixin_argument.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ def decorate_argument_parser(self, *, parser): # noqa: D102
5151

5252
if sys.version_info[:2] >= (3, 7):
5353
def __getattr__(name):
54-
global VERB_BLOCKLIST
5554
if name == 'VERB_BLACKLIST':
5655
warnings.warn(
5756
"'colcon_mixin.mixin.mixin_argument.VERB_BLACKLIST' has been "
@@ -121,8 +120,6 @@ def parse_known_args(self, *args, **kwargs):
121120

122121
def parse_args(self, *args, **kwargs):
123122
"""Add mixin argument for each parser."""
124-
global VERB_BLOCKLIST
125-
126123
# mapping of all "leaf" verbs to parsers
127124
def collect_parsers_by_verb(root, parsers, parent_verbs=()):
128125
found_any = False

colcon_mixin/mixin/repository.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ def get_repositories():
2626
2727
:rtype: dict
2828
"""
29-
global mixin_repositories_file
3029
if not mixin_repositories_file.exists():
3130
return {}
3231
if mixin_repositories_file.is_dir():
@@ -46,7 +45,6 @@ def set_repositories(repositories):
4645
"""
4746
assert isinstance(repositories, dict), \
4847
'The passed repositories should be a dictionary'
49-
global mixin_repositories_file
5048
data = yaml.dump(repositories, default_flow_style=False)
5149
os.makedirs(str(mixin_repositories_file.parent), exist_ok=True)
5250
with mixin_repositories_file.open('w') as h:

colcon_mixin/subverb/show.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
def _get_mixin_name_completer(verb_key, mixins_by_verb):
1010
def mixin_name_completer(prefix, **kwargs):
1111
"""Callable returning a list of mixin names."""
12-
nonlocal mixins_by_verb
1312
args = kwargs.get('parsed_args', {})
1413
verb = getattr(args, verb_key)
1514
key = tuple(verb.split('.'))

test/test_spell_check.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
@pytest.fixture(scope='module')
1212
def known_words():
13-
global spell_check_words_path
1413
return spell_check_words_path.read_text().splitlines()
1514

1615

0 commit comments

Comments
 (0)