mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-06 12:06:53 +00:00
reached 100% testing cover
This commit is contained in:
parent
a9d54a63fc
commit
8e79502b8a
10 changed files with 13 additions and 0 deletions
|
|
@ -18,6 +18,7 @@ class ModelNameAttributeChecker(FileBunchesLinesCheckerTemplateMethod):
|
|||
self.__inherit_line = ''
|
||||
|
||||
def _get_regexp(self):
|
||||
super(ModelNameAttributeChecker, self)._get_regexp()
|
||||
return r'^(\t| )*class.+'
|
||||
|
||||
def _check_file(self):
|
||||
|
|
@ -39,6 +40,7 @@ class ModelNameAttributeChecker(FileBunchesLinesCheckerTemplateMethod):
|
|||
We will use this inherited method (which runs through all file lines) in order to gather lines that are required
|
||||
to perform the lines bunch check.
|
||||
"""
|
||||
super(ModelNameAttributeChecker, self)._check_line()
|
||||
if self.__name_pattern.match(self._file_line):
|
||||
self.__name_line = self._file_line.strip('_name = ')
|
||||
if self.__inherit_pattern.match(self._file_line):
|
||||
|
|
|
|||
|
|
@ -17,9 +17,11 @@ class ViewFieldsOrderChecker(FileBunchesCheckerTemplateMethod):
|
|||
self._model_line = None
|
||||
|
||||
def _get_regexp(self):
|
||||
super(ViewFieldsOrderChecker, self)._get_regexp()
|
||||
return r'^(\t| )*<record id=.+ model="ir.ui.view">(\t| )*'
|
||||
|
||||
def _check_bunch(self):
|
||||
super(ViewFieldsOrderChecker, self)._check_bunch()
|
||||
self._record_line = self._bunch_of_lines[0].strip()
|
||||
self._name_line = self._bunch_of_lines[1]
|
||||
self._model_line = self._bunch_of_lines[2]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue