Skip to content

Commit

Permalink
Allow semicolon at end of line
Browse files Browse the repository at this point in the history
Resolves   #859.
  • Loading branch information
evhub committed Nov 26, 2024
1 parent 7041fcb commit dfca89b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,6 @@ The style issues which will cause `--strict` to throw an error are:
- use of `"hello" "world"` implicit string concatenation (use explicit `+` instead)
- use of `from __future__` imports (Coconut does these automatically)
- inheriting from `object` in classes (Coconut does this automatically)
- semicolons at end of lines
- use of `u` to denote Unicode strings (all Coconut strings are Unicode strings)
- `f`-strings with no format expressions in them
- commas after [statement lambdas](#statement-lambdas) (not recommended as it can be unclear whether the comma is inside or outside the lambda)
Expand Down
3 changes: 2 additions & 1 deletion coconut/compiler/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -5399,7 +5399,8 @@ def lambdef_check(self, original, loc, tokens):

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

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

0 comments on commit dfca89b

Please sign in to comment.