Skip to content

Commit dfca89b

Browse files
committed
Allow semicolon at end of line
Resolves #859.
1 parent 7041fcb commit dfca89b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

DOCS.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,6 @@ The style issues which will cause `--strict` to throw an error are:
341341
- use of `"hello" "world"` implicit string concatenation (use explicit `+` instead)
342342
- use of `from __future__` imports (Coconut does these automatically)
343343
- inheriting from `object` in classes (Coconut does this automatically)
344-
- semicolons at end of lines
345344
- use of `u` to denote Unicode strings (all Coconut strings are Unicode strings)
346345
- `f`-strings with no format expressions in them
347346
- commas after [statement lambdas](#statement-lambdas) (not recommended as it can be unclear whether the comma is inside or outside the lambda)

coconut/compiler/compiler.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5399,7 +5399,8 @@ def lambdef_check(self, original, loc, tokens):
53995399

54005400
def endline_semicolon_check(self, original, loc, tokens):
54015401
"""Check for semicolons at the end of lines."""
5402-
return self.check_strict("semicolon at end of line", original, loc, tokens, always_warn=True)
5402+
# only warn since this can have a real impact in jupyter notebooks (#859)
5403+
return self.check_strict("semicolon at end of line", original, loc, tokens, only_warn=True)
54035404

54045405
def u_string_check(self, original, loc, tokens):
54055406
"""Check for Python-2-style unicode strings."""

0 commit comments

Comments
 (0)