Skip to content

Commit 17bd45c

Browse files
committed
Fixing lint errors
1 parent c3276ed commit 17bd45c

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

d8s_python/ast_data.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,8 @@ def python_function_docstrings(
263263

264264
def python_variable_names(code_text: str) -> List[str]:
265265
"""Get all of the variables names in the code_text."""
266-
# TODO: add a caveat that this function will only find *stored* variables and not those which are referenced or loaded. E.g., given "x = y + 1", this function will return ["x"]; note that "y" is not included
266+
# TODO: add a caveat that this function will only find *stored* variables and not those which are referenced or...
267+
# loaded. E.g., given "x = y + 1", this function will return ["x"]; note that "y" is not included
267268
parsed_code = python_ast_parse(code_text)
268269
variable_names = [
269270
node.id for node in ast.walk(parsed_code) if isinstance(node, ast.Name) and (isinstance(node.ctx, ast.Store))

d8s_python/python_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def python_function_blocks(
109109
function_block_line_numbers = [(f.name, python_ast_object_line_numbers(f)) for f in ast_function_defs]
110110

111111
for function_name, (start, end) in function_block_line_numbers:
112-
function_block_lines = code_text_as_lines[start - 1 : end]
112+
function_block_lines = code_text_as_lines[start - 1 : end] # noqa=E203
113113
function_block_string = '\n'.join(function_block_lines)
114114

115115
if ignore_private_functions:

tests/test_python_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def a():
226226
def test_python_functions_signatures_docs_1():
227227
s = '''def string_remove_numbers(input_string: str, replacement: str = ' ') -> str:
228228
"""Remove all numbers from the input_strings."""
229-
new_string_without_numbers = replace('\d+', replacement, input_string)
229+
new_string_without_numbers = replace('\\d+', replacement, input_string)
230230
return new_string_without_numbers'''
231231
results = python_functions_signatures(s)
232232
print(f'results {results} ')

0 commit comments

Comments
 (0)