Closed amoskong closed 3 years ago
First of all, this Python code is incorrect.
def help():
session.execute("
CREATE KEYSPACE ks WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 3 };
")
$ python mycode.py
File "mycode.py", line 2
session.execute("
^
SyntaxError: EOL while scanning string literal
And if we pass that code to pycodestyle, it will detect the error. However, I don't think we can take care of this because it is invalid Python code.
autopep8 also uses pycodestyle in the backend, so it works the same way.
@amoskong you should write the code like this(pay attention to the triple quotes):
def help():
session.execute("""
CREATE KEYSPACE ks WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 3 };
""")
Description
Hi, I touched a problem in checking coding style by autopep8, the string content (cqlsh statement) will be reported as problem.
/CC @asias
Python Code
Command Line and Configuration
.pep8
,setup.cfg
, ...Command Line
Your Environment
No problem for string with 3 quotes
No problem for string with 1 quotes in same line