Commit a4e0fb2d authored by Jérome Perrin's avatar Jérome Perrin

CodingStyle: ignore more skins and prefixs

Module is an acceptable prefix for modules

Introduce a list of skins IDs that does not match our conventions but
are acceptable because this is what external API are calling.
parent f98f1411
...@@ -77,18 +77,32 @@ def getSkinPrefixList(self): ...@@ -77,18 +77,32 @@ def getSkinPrefixList(self):
# Add other prefix # Add other prefix
skin_prefix_list.extend(( skin_prefix_list.extend((
'ERP5Type', 'ERP5Type',
'Module',
'Brain', # Catalog brains
'DCWorkflow', # some workflow script use this, not sure it's correct.
'SkinsTool',
'Entity', # A base class for Person / Organisation 'Entity', # A base class for Person / Organisation
'Zuite', # Products.Zelenium test suites 'Zuite', # Products.Zelenium test suites
'Form', # Acceptable for ERP5 Forms which will soon become portal types too
# ERP5Form
'Form',
'ListBox', 'ListBox',
'DCWorkflow', # some workflow script use this, not sure it's correct. 'PlanningBox',
'Zuite', # from Zelenium 'OOoChart',
'Brain', # Catalog brains
)) ))
return set(skin_prefix_list) return set(skin_prefix_list)
# Some skin names that does not respect our conventions but are ignored, for example
# when this naming is used by zope.
ignored_skin_id_set = {
'twiddleAuthCookie',
'setAuthCookie',
}
# Generic method to check consistency of a skin item # Generic method to check consistency of a skin item
def checkConsistency(self, fixit=0, source_code=None): def checkConsistency(self, fixit=0, source_code=None):
""" """
...@@ -103,7 +117,7 @@ def checkConsistency(self, fixit=0, source_code=None): ...@@ -103,7 +117,7 @@ def checkConsistency(self, fixit=0, source_code=None):
# Make sure id is acceptable # Make sure id is acceptable
document_id = self.id document_id = self.id
if document_id != document_id.lower(): if document_id != document_id.lower() and document_id not in ignored_skin_id_set:
# Only test prefix with big caps # Only test prefix with big caps
prefix = document_id.split('_')[0] prefix = document_id.split('_')[0]
if prefix not in getSkinPrefixList(self): if prefix not in getSkinPrefixList(self):
......
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