Skip to content

Commit

Permalink
Merge pull request #143 from edx/bom-2341
Browse files Browse the repository at this point in the history
BOM-2341 : Don't put amnesty on line continuation
  • Loading branch information
M. Zulqarnain authored Mar 16, 2021
2 parents c79c938 + 901fd1c commit 0b621e2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ Change Log
Unreleased
~~~~~~~~~~

[4.1.1] - 2021-03-16
~~~~~~~~~~~~~~~~~~~~

* Fixed lint amnesty breakage on line continuation


[4.1.0] - 2021-02-24
~~~~~~~~~~~~~~~~~~~~

Expand Down
2 changes: 1 addition & 1 deletion edx_lint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
edx_lint standardizes lint configuration and additional plugins for use in
Open edX code.
"""
VERSION = "4.1.0"
VERSION = "4.1.1"
5 changes: 5 additions & 0 deletions edx_lint/cmd/amnesty.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ def pylint_amnesty(pylint_output):
with opened_file as input_file:
output_lines = []
for line_num, line in enumerate(input_file, start=1):
# If the line ends with backslash, take the amnesty to next line because line of code has not ended
if line.endswith('\\\n'):
errors[file_with_errors][line_num + 1] = errors[file_with_errors][line_num]
errors[file_with_errors][line_num] = set()

output_lines.extend(fix_pylint(line, errors[file_with_errors][line_num]))

with open(file_with_errors, "w") as output_file:
Expand Down

0 comments on commit 0b621e2

Please sign in to comment.