From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 83B5D138332 for ; Fri, 30 Mar 2018 05:20:51 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 522CDE093A; Fri, 30 Mar 2018 05:20:50 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 17ADFE093A for ; Fri, 30 Mar 2018 05:20:50 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C96D0335D2E for ; Fri, 30 Mar 2018 05:20:48 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id ACBCB271 for ; Fri, 30 Mar 2018 05:20:46 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1522381878.4a63297643accd75971622000f15613200501081.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/modules/linechecks/nested/ X-VCS-Repository: proj/portage X-VCS-Files: repoman/pym/repoman/modules/linechecks/nested/__init__.py repoman/pym/repoman/modules/linechecks/nested/nested.py repoman/pym/repoman/modules/linechecks/nested/nesteddie.py X-VCS-Directories: repoman/pym/repoman/modules/linechecks/nested/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 4a63297643accd75971622000f15613200501081 X-VCS-Branch: repoman Date: Fri, 30 Mar 2018 05:20:46 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 84b2b540-da40-4282-b1e6-ed89ff435713 X-Archives-Hash: 19137b9f3c935c0d725bb7bba07dbe95 Message-ID: <20180330052046.bMq9e5VomluIyeFWICWMU6TzX2P9eqtV4u3Q5xgaceU@z> commit: 4a63297643accd75971622000f15613200501081 Author: Brian Dolbec gentoo org> AuthorDate: Sat Jul 15 01:02:24 2017 +0000 Commit: Zac Medico gentoo org> CommitDate: Fri Mar 30 03:51:18 2018 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=4a632976 repoman: New linechecks module, nested .../repoman/modules/linechecks/nested/__init__.py | 21 +++++++++++++++++++++ .../pym/repoman/modules/linechecks/nested/nested.py | 15 +++++++++++++++ .../repoman/modules/linechecks/nested/nesteddie.py | 11 +++++++++++ 3 files changed, 47 insertions(+) diff --git a/repoman/pym/repoman/modules/linechecks/nested/__init__.py b/repoman/pym/repoman/modules/linechecks/nested/__init__.py new file mode 100644 index 000000000..8eeeccbac --- /dev/null +++ b/repoman/pym/repoman/modules/linechecks/nested/__init__.py @@ -0,0 +1,21 @@ +# Copyright 2015-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +doc = """Nested plug-in module for repoman LineChecks. +Performs nested subshell checks on ebuilds.""" +__doc__ = doc[:] + + +module_spec = { + 'name': 'do', + 'description': doc, + 'provides':{ + 'nesteddie-check': { + 'name': "nesteddie", + 'sourcefile': "nested", + 'class': "EbuildNestedDie", + 'description': doc, + }, + } +} + diff --git a/repoman/pym/repoman/modules/linechecks/nested/nested.py b/repoman/pym/repoman/modules/linechecks/nested/nested.py new file mode 100644 index 000000000..06b272772 --- /dev/null +++ b/repoman/pym/repoman/modules/linechecks/nested/nested.py @@ -0,0 +1,15 @@ + +import re + +from repoman.modules.linechecks.base import LineCheck + + +class EbuildNestedDie(LineCheck): + """Check ebuild for nested die statements (die statements in subshells)""" + + repoman_check_name = 'ebuild.nesteddie' + nesteddie_re = re.compile(r'^[^#]*\s\(\s[^)]*\bdie\b') + + def check(self, num, line): + if self.nesteddie_re.match(line): + return self.errors['NESTED_DIE_ERROR'] diff --git a/repoman/pym/repoman/modules/linechecks/nested/nesteddie.py b/repoman/pym/repoman/modules/linechecks/nested/nesteddie.py new file mode 100644 index 000000000..6c1e4be9f --- /dev/null +++ b/repoman/pym/repoman/modules/linechecks/nested/nesteddie.py @@ -0,0 +1,11 @@ + + +class EbuildNestedDie(LineCheck): + """Check ebuild for nested die statements (die statements in subshells)""" + + repoman_check_name = 'ebuild.nesteddie' + nesteddie_re = re.compile(r'^[^#]*\s\(\s[^)]*\bdie\b') + + def check(self, num, line): + if self.nesteddie_re.match(line): + return errors.NESTED_DIE_ERROR