diff options
author | Zac Medico <zmedico@gentoo.org> | 2012-10-08 07:17:20 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2012-10-08 07:17:20 -0700 |
commit | 202a55ef437e8d472f25a8013b5694efee855e78 (patch) | |
tree | 001d25c15601ff321d3078af77037c451fdc7704 | |
parent | 70f580e22e82dc26831cd759c56501c72a8db00f (diff) | |
download | portage-202a55ef437e8d472f25a8013b5694efee855e78.tar.gz portage-202a55ef437e8d472f25a8013b5694efee855e78.tar.bz2 portage-202a55ef437e8d472f25a8013b5694efee855e78.zip |
repoman: simplify EbuildAssignment check
The line continuation code is no longer needed since commit
a1578c654f26cab07309bc9cbddd3c95c0c205b5, because wrapped lines are
automatically joined before they are passed to the check. Also, inherit
ignore_comment = True from LineCheck.
-rw-r--r-- | pym/repoman/checks.py | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py index 9c076ead4..7e3d4b875 100644 --- a/pym/repoman/checks.py +++ b/pym/repoman/checks.py @@ -221,21 +221,13 @@ class EbuildAssignment(LineCheck): """Ensure ebuilds don't assign to readonly variables.""" repoman_check_name = 'variable.readonly' - readonly_assignment = re.compile(r'^\s*(export\s+)?(A|CATEGORY|P|PV|PN|PR|PVR|PF|D|WORKDIR|FILESDIR|FEATURES|USE)=') - line_continuation = re.compile(r'([^#]*\S)(\s+|\t)\\$') - ignore_line = re.compile(r'(^$)|(^(\t)*#)') - ignore_comment = False - - def __init__(self): - self.previous_line = None def check(self, num, line): match = self.readonly_assignment.match(line) e = None - if match and (not self.previous_line or not self.line_continuation.match(self.previous_line)): + if match is not None: e = errors.READONLY_ASSIGNMENT_ERROR - self.previous_line = line return e class Eapi3EbuildAssignment(EbuildAssignment): |