Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pylint alerts corrections as part of an intervention experiment 401 #402

Closed
wants to merge 10 commits into from
2 changes: 1 addition & 1 deletion plugins/command_completions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ class SublimeTextCommandCompletionPythonListener(sublime_plugin.EventListener):
@inhibit_word_completions
def on_query_completions(self, view, prefix, locations):
loc = locations[0]
python_arg_scope = ("source.python meta.function-call.arguments.python string.quoted")
python_arg_scope = "source.python meta.function-call.arguments.python string.quoted"
if not view.score_selector(loc, python_arg_scope) or not is_plugin(view):
return None

Expand Down
4 changes: 3 additions & 1 deletion plugins/create_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ def _create_package(name):
os.mkdir(path)
except FileExistsError:
logger.error("Path exists already: %r", path)
except Exception:
except FileNotFoundError:
logger.error("Parent path does not exist: %r", path)
except OSError:
logger.exception("Unknown error while creating path %r", path)
else:
return path
Expand Down
5 changes: 3 additions & 2 deletions plugins/lib/fileconv/dumpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,10 @@
(lambda x: x is None, False))
]
"""
pass
raise NotImplementedError


def _validate_data(self, data, funcs):

Check failure on line 103 in plugins/lib/fileconv/dumpers.py

View workflow job for this annotation

GitHub Actions / Flake8

too many blank lines (2)
"""Check for incompatible data recursively.

``funcs`` is supposed to be a set, or just iterable two times and
Expand Down Expand Up @@ -178,7 +179,7 @@

def write(self, data, *args, **kwargs):
"""To be implemented."""
pass
raise NotImplementedError


class JSONDumper(DumperProto):
Expand Down
3 changes: 2 additions & 1 deletion plugins/lib/fileconv/loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,11 @@
"""To be implemented. Should return the parsed data from
``self.file_path`` as a Python object.
"""
pass
raise NotImplementedError



class JSONLoader(LoaderProto):

Check failure on line 302 in plugins/lib/fileconv/loaders.py

View workflow job for this annotation

GitHub Actions / Flake8

too many blank lines (3)
name = "JSON"
ext = "json"
comment = "//"
Expand Down
2 changes: 1 addition & 1 deletion plugins/new_resource_file/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@ def _is_package_path(self, file_path):
for fp in (real_file_path, file_path):
if fp.startswith(pp):
leaf = fp[len(pp):].strip(os.sep)
return (os.sep not in leaf)
return os.sep not in leaf
31 changes: 18 additions & 13 deletions plugins/syntax_dev/completions.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,42 +232,47 @@
return all(self.view.match_selector(point + offset, selector)
for point in locations)

result = None

# None of our business
if not match_selector("- comment - (source.regexp - keyword.other.variable)"):
return None
result = None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since result is already defined earlier, this could be a pass and can be interpreted as "don't change the default return value".


# Scope name completions based on our scope_data database
if match_selector("meta.expect-scope, meta.scope", -1):
return self._complete_scope(prefix, locations)
elif match_selector("meta.expect-scope, meta.scope", -1):
result = self._complete_scope(prefix, locations)

# Auto-completion for include values using the 'contexts' keys and for
if match_selector(
elif match_selector(
"meta.expect-context-list-or-content | meta.context-list-or-content",
-1,
):
return ((self._complete_keyword(prefix, locations) or [])
result = ((self._complete_keyword(prefix, locations) or [])
+ self._complete_context(prefix, locations))

Check failure on line 251 in plugins/syntax_dev/completions.py

View workflow job for this annotation

GitHub Actions / Flake8

continuation line under-indented for visual indent

# Auto-completion for include values using the 'contexts' keys
if match_selector(
elif match_selector(
"meta.expect-context-list | meta.expect-context | meta.include | meta.context-list",
-1,
):
return self._complete_context(prefix, locations) or None
result = self._complete_context(prefix, locations) or None

# Auto-completion for branch points with 'fail' key
if match_selector(
elif match_selector(
"meta.expect-branch-point-reference | meta.branch-point-reference",
-1,
):
return self._complete_branch_point()
result = self._complete_branch_point()

# Auto-completion for variables in match patterns using 'variables' keys
if match_selector("keyword.other.variable"):
return self._complete_variable()
elif match_selector("keyword.other.variable"):
result = self._complete_variable()

# Standard completions for unmatched regions
return self._complete_keyword(prefix, locations)
else:
# Standard completions for unmatched regions
result = self._complete_keyword(prefix, locations)

Check warning on line 274 in plugins/syntax_dev/completions.py

View workflow job for this annotation

GitHub Actions / Flake8

blank line contains whitespace
return result

def _line_prefix(self, point):
_, col = self.view.rowcol(point)
Expand Down
Loading