Commit 94053d30 authored by Jérome Perrin's avatar Jérome Perrin

Enable coding style test on erp5_hal_hjson_style, erp5_web_renderjs_ui_test and erp5_ui_test

This uses a different approach that what I was using in the past. I'm no longer trying to rename skins that does not match our naming conventions, but just adding them the the "ignore list".

This would still allow to detect when new wrongly named scripts are introduced without risking regressions when we rename a script that was used from some places we did not change (like project customisations).

/reviewed-on nexedi/erp5!1041
parents 522ae495 dfe9ccd4
...@@ -16,7 +16,7 @@ import json ...@@ -16,7 +16,7 @@ import json
import re import re
import urllib import urllib
from zope.globalrequest import setRequest from zope.globalrequest import setRequest # pylint: disable=no-name-in-module, import-error
from Acquisition import aq_base from Acquisition import aq_base
from Products.ERP5Form.Selection import Selection, DomainSelection from Products.ERP5Form.Selection import Selection, DomainSelection
......
...@@ -7,6 +7,6 @@ if preference is None: ...@@ -7,6 +7,6 @@ if preference is None:
portal_type="Preference") portal_type="Preference")
if preference.getPreferenceState() != "enabled": if preference.getPreferenceState() != "enabled":
preference.enable() preference.enable()
return 'Set Preference Successfully.' return 'Set Preference Successfully.'
request = context.REQUEST
context.portal_workflow.doActionFor(context , workflow_action, comment='', **kw) context.portal_workflow.doActionFor(context , workflow_action, comment='', **kw)
message = 'direct workflow action done.' message = 'direct workflow action done.'
return context.Base_redirect('view', keep_items={'portal_status_message': message}) return context.Base_redirect('view', keep_items={'portal_status_message': message})
# this script has a parameter named `id`
# pylint: disable=redefined-builtin
"""Redirect to Foo_viewFormBox""" """Redirect to Foo_viewFormBox"""
msg = "%s %s %s %s" % (id, title, quantity, description) msg = "%s %s %s %s" % (id, title, quantity, description)
......
...@@ -8,4 +8,4 @@ kw = { ...@@ -8,4 +8,4 @@ kw = {
# 'selection_params': {}, # 'selection_params': {},
'temporary_selection': False, 'temporary_selection': False,
} }
return [ReportSection(**kw) for x in xrange(3)] return [ReportSection(**kw) for _ in xrange(3)]
...@@ -13,7 +13,7 @@ default_columns = '\n'.join(( 'id | ID' ...@@ -13,7 +13,7 @@ default_columns = '\n'.join(( 'id | ID'
, 'title | Title' , 'title | Title'
, 'quantity | Quantity' , 'quantity | Quantity'
)) ))
result = form.listbox.ListBox_setPropertyList( form.listbox.ListBox_setPropertyList(
field_title = 'Bars' field_title = 'Bars'
, field_columns = default_columns , field_columns = default_columns
, field_sort = 'id' , field_sort = 'id'
......
...@@ -8,7 +8,7 @@ for name in ('foo_module', 'bar_module', 'foo_bar_module'): ...@@ -8,7 +8,7 @@ for name in ('foo_module', 'bar_module', 'foo_bar_module'):
# Reset the foo module listbox # Reset the foo module listbox
form = context.FooModule_viewFooList form = context.FooModule_viewFooList
result = form.listbox.ListBox_setPropertyList() form.listbox.ListBox_setPropertyList()
#form.listbox.manage_edit(dict( #form.listbox.manage_edit(dict(
# lines = 3, all_columns = [], search_columns = [], sort_columns = [], # lines = 3, all_columns = [], search_columns = [], sort_columns = [],
...@@ -22,7 +22,7 @@ default_columns = '\n'.join(( 'id | ID' ...@@ -22,7 +22,7 @@ default_columns = '\n'.join(( 'id | ID'
, 'title | Title' , 'title | Title'
, 'quantity | Quantity' , 'quantity | Quantity'
)) ))
result = form.listbox.ListBox_setPropertyList( form.listbox.ListBox_setPropertyList(
field_title = 'Foo Lines' field_title = 'Foo Lines'
, field_columns = default_columns , field_columns = default_columns
, field_sort = 'id' , field_sort = 'id'
......
# this script has a parameter named `id`
# pylint: disable=redefined-builtin
"""Add or replace an action on a type informations from types tool. """Add or replace an action on a type informations from types tool.
""" """
assert context.meta_type in ('ERP5 Type Information', 'ERP5 Base Type'), context.meta_type assert context.meta_type in ('ERP5 Type Information', 'ERP5 Base Type'), context.meta_type
......
# this script has a parameter named `id`
# pylint: disable=redefined-builtin
"""Delete an action on a type informations from types tool. """Delete an action on a type informations from types tool.
""" """
assert context.meta_type in ('ERP5 Type Information', 'ERP5 Base Type'), context.meta_type assert context.meta_type in ('ERP5 Type Information', 'ERP5 Base Type'), context.meta_type
......
...@@ -82,6 +82,7 @@ def getSkinPrefixList(self): ...@@ -82,6 +82,7 @@ def getSkinPrefixList(self):
'DCWorkflow', # some workflow script use this, not sure it's correct. 'DCWorkflow', # some workflow script use this, not sure it's correct.
'SkinsTool', 'SkinsTool',
'MailHost',
'Entity', # A base class for Person / Organisation 'Entity', # A base class for Person / Organisation
'Zuite', # Products.Zelenium test suites 'Zuite', # Products.Zelenium test suites
...@@ -97,10 +98,32 @@ def getSkinPrefixList(self): ...@@ -97,10 +98,32 @@ def getSkinPrefixList(self):
# Some skin names that does not respect our conventions but are ignored, for example # Some skin names that does not respect our conventions but are ignored, for example
# when this naming is used by zope. # when this naming is used by zope or scripts that changing would be too hard.
ignored_skin_id_set = { ignored_skin_id_set = {
'twiddleAuthCookie', 'twiddleAuthCookie',
'setAuthCookie', 'setAuthCookie',
'ERP5Document_getHateoas',
'Script_getParams',
'AccessTabZuite_disablePreference',
'AccessTabZuite_setPreference',
'BTZuite_CommonTemplate',
'BTZuite_reset',
'FooViewDummyMultiListFieldDialog_setFieldPropertyList',
'FooView_setFieldsProperties',
'ListBoxDialogModeZuite_CommonTemplate',
'ListBoxDialogModeZuite_reset',
'ListBoxZuite_CommonTemplate',
'ListBoxZuite_getSelectionCheckedUidsAsHtml',
'ListBoxZuite_reset',
'ListBoxZuite_resetReportSelections',
'ListBoxZuite_setPreferredListboxViewModeLineCount',
'MatrixBoxZuite_CommonTemplate',
'OOoImportZuite_importFile',
'OOoImportZuite_reset',
'PTZuite_CommonTemplate',
'PortalType_addAction',
'PortalType_deleteAction',
'RelationFieldZuite_CommonTemplate',
} }
# Generic method to check consistency of a skin item # Generic method to check consistency of a skin item
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment