public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:master commit in: repoman/pym/repoman/modules/linechecks/nested/
@ 2018-03-30  4:23 Zac Medico
  2018-03-30  5:20 ` [gentoo-commits] proj/portage:repoman " Zac Medico
  0 siblings, 1 reply; 2+ messages in thread
From: Zac Medico @ 2018-03-30  4:23 UTC (permalink / raw
  To: gentoo-commits

commit:     4a63297643accd75971622000f15613200501081
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 15 01:02:24 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/modules/linechecks/nested/
  2018-03-30  4:23 [gentoo-commits] proj/portage:master commit in: repoman/pym/repoman/modules/linechecks/nested/ Zac Medico
@ 2018-03-30  5:20 ` Zac Medico
  0 siblings, 0 replies; 2+ messages in thread
From: Zac Medico @ 2018-03-30  5:20 UTC (permalink / raw
  To: gentoo-commits

commit:     4a63297643accd75971622000f15613200501081
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 15 01:02:24 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-03-30  5:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-30  4:23 [gentoo-commits] proj/portage:master commit in: repoman/pym/repoman/modules/linechecks/nested/ Zac Medico
2018-03-30  5:20 ` [gentoo-commits] proj/portage:repoman " Zac Medico

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox