From 202a55ef437e8d472f25a8013b5694efee855e78 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 8 Oct 2012 07:17:20 -0700 Subject: [PATCH] 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. --- pym/repoman/checks.py | 10 +--------- 1 file changed, 1 insertion(+), 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): -- 2.26.2