Update pycodestyle to 2.5.0. Allow newer versions so we can catch issues early.

This commit is contained in:
Dave Page
2019-03-20 13:01:32 +00:00
parent 48c3763e95
commit 906a4a845e
7 changed files with 16 additions and 16 deletions

View File

@@ -1,5 +1,5 @@
[pycodestyle] [pycodestyle]
ignore = E402 ignore = E402,W504,W605
max-line-length = 79 max-line-length = 79
statistics = True statistics = True
show-source = False show-source = False

View File

@@ -541,7 +541,7 @@ class EventTriggerView(PGChildNodeView):
) )
except Exception as e: except Exception as e:
return internal_server_error(errormsg=str(e)) return internal_server_error(errormsg=str(e))
@check_precondition @check_precondition
def msql(self, gid, sid, did, etid=None): def msql(self, gid, sid, did, etid=None):

View File

@@ -587,7 +587,7 @@ class ForeignServerView(PGChildNodeView):
if not isinstance(sql, (str, unicode)): if not isinstance(sql, (str, unicode)):
return sql return sql
if sql == '': if sql == '':
sql = "--modified SQL" sql = "--modified SQL"
return make_json_response( return make_json_response(
data=sql.strip('\n'), data=sql.strip('\n'),

View File

@@ -111,11 +111,11 @@ def create_procedure(server, db_name, schema_name, func_name, s_type,
server['sslmode']) server['sslmode'])
pg_cursor = connection.cursor() pg_cursor = connection.cursor()
if s_type == 'pg': if s_type == 'pg':
query = "CREATE PROCEDURE {0}.{1}" \ query = "CREATE PROCEDURE {0}.{1}" \
"({2})" \ "({2})" \
" LANGUAGE 'sql'" \ " LANGUAGE 'sql'" \
" SECURITY DEFINER AS $$" \ " SECURITY DEFINER AS $$" \
" SELECT 1; $$;".format(schema_name, func_name, args) " SELECT 1; $$;".format(schema_name, func_name, args)
else: else:
if s_version >= 90500: if s_version >= 90500:
query = "CREATE PROCEDURE {0}.{1}" \ query = "CREATE PROCEDURE {0}.{1}" \

View File

@@ -301,7 +301,7 @@ class TableView(BaseTableView, DataTypeReader, VacuumSettings):
if not status: if not status:
return internal_server_error(errormsg=rset) return internal_server_error(errormsg=rset)
if len(rset['rows']) == 0: if len(rset['rows']) == 0:
return gone(gettext("Could not find the table.")) return gone(gettext("Could not find the table."))
table_information = rset['rows'][0] table_information = rset['rows'][0]
icon = self.get_icon_css_class(table_information) icon = self.get_icon_css_class(table_information)
@@ -574,7 +574,7 @@ class TableView(BaseTableView, DataTypeReader, VacuumSettings):
return internal_server_error(errormsg=res) return internal_server_error(errormsg=res)
if len(res['rows']) == 0: if len(res['rows']) == 0:
return gone(gettext("The specified table could not be found.")) return gone(gettext("The specified table could not be found."))
# We will check the threshold set by user before executing # We will check the threshold set by user before executing
# the query because that can cause performance issues # the query because that can cause performance issues
@@ -1302,7 +1302,7 @@ class TableView(BaseTableView, DataTypeReader, VacuumSettings):
return internal_server_error(errormsg=res) return internal_server_error(errormsg=res)
if len(res['rows']) == 0: if len(res['rows']) == 0:
return gone(gettext("The specified table could not be found.")) return gone(gettext("The specified table could not be found."))
data = res['rows'][0] data = res['rows'][0]

View File

@@ -361,8 +361,8 @@ class PartitionsView(BaseTableView, DataTypeReader, VacuumSettings):
return internal_server_error(errormsg=res) return internal_server_error(errormsg=res)
if len(res['rows']) == 0: if len(res['rows']) == 0:
return gone(gettext( return gone(gettext(
"The specified partitioned table could not be found.")) "The specified partitioned table could not be found."))
return super(PartitionsView, self).properties( return super(PartitionsView, self).properties(
gid, sid, did, scid, ptid, res) gid, sid, did, scid, ptid, res)
@@ -392,8 +392,8 @@ class PartitionsView(BaseTableView, DataTypeReader, VacuumSettings):
return internal_server_error(errormsg=res) return internal_server_error(errormsg=res)
if len(res['rows']) == 0: if len(res['rows']) == 0:
return gone(gettext( return gone(gettext(
"The specified partitioned table could not be found.")) "The specified partitioned table could not be found."))
data = res['rows'][0] data = res['rows'][0]

View File

@@ -10,7 +10,7 @@ extras==1.0.0
fixtures==3.0.0 fixtures==3.0.0
linecache2==1.0.0 linecache2==1.0.0
pbr==3.1.1 pbr==3.1.1
pycodestyle==2.3.1 pycodestyle>=2.5.0
pyperclip~=1.6.0 pyperclip~=1.6.0
python-mimeparse==1.6.0 python-mimeparse==1.6.0
testscenarios==0.5.0 testscenarios==0.5.0