public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/modules/linechecks/useless/
@ 2017-07-15  2:08 Brian Dolbec
  0 siblings, 0 replies; 9+ messages in thread
From: Brian Dolbec @ 2017-07-15  2:08 UTC (permalink / raw
  To: gentoo-commits

commit:     c53c37c1f9c609837073600709a153779120238a
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 15 01:06:38 2017 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat Jul 15 02:08:28 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c53c37c1

repoman: New linechecks module, useless

 .../repoman/modules/linechecks/useless/__init__.py | 27 ++++++++++++++++++++++
 .../pym/repoman/modules/linechecks/useless/cd.py   | 24 +++++++++++++++++++
 .../repoman/modules/linechecks/useless/dodoc.py    | 16 +++++++++++++
 3 files changed, 67 insertions(+)

diff --git a/repoman/pym/repoman/modules/linechecks/useless/__init__.py b/repoman/pym/repoman/modules/linechecks/useless/__init__.py
new file mode 100644
index 000000000..acc4479f5
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/useless/__init__.py
@@ -0,0 +1,27 @@
+# Copyright 2015-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+doc = """Useless plug-in module for repoman LineChecks.
+Performs checks for useless operations on ebuilds."""
+__doc__ = doc[:]
+
+
+module_spec = {
+	'name': 'do',
+	'description': doc,
+	'provides':{
+		'uselesscds-check': {
+			'name': "uselesscds",
+			'sourcefile': "cd",
+			'class': "EbuildUselessCdS",
+			'description': doc,
+		},
+		'uselessdodoc-check': {
+			'name': "uselessdodoc",
+			'sourcefile': "dodoc",
+			'class': "EbuildUselessDodoc",
+			'description': doc,
+		},
+	}
+}
+

diff --git a/repoman/pym/repoman/modules/linechecks/useless/cd.py b/repoman/pym/repoman/modules/linechecks/useless/cd.py
new file mode 100644
index 000000000..3daa04451
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/useless/cd.py
@@ -0,0 +1,24 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildUselessCdS(LineCheck):
+	"""Check for redundant cd ${S} statements"""
+	repoman_check_name = 'ebuild.minorsyn'
+	_src_phases = r'^\s*src_(prepare|configure|compile|install|test)\s*\(\)'
+	method_re = re.compile(_src_phases)
+	cds_re = re.compile(r'^\s*cd\s+("\$(\{S\}|S)"|\$(\{S\}|S))\s')
+
+	def __init__(self, errors):
+		self.errors = errors
+		self.check_next_line = False
+
+	def check(self, num, line):
+		if self.check_next_line:
+			self.check_next_line = False
+			if self.cds_re.match(line):
+				return self.errors['REDUNDANT_CD_S_ERROR']
+		elif self.method_re.match(line):
+			self.check_next_line = True

diff --git a/repoman/pym/repoman/modules/linechecks/useless/dodoc.py b/repoman/pym/repoman/modules/linechecks/useless/dodoc.py
new file mode 100644
index 000000000..502bfbea8
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/useless/dodoc.py
@@ -0,0 +1,16 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildUselessDodoc(LineCheck):
+	"""Check ebuild for useless files in dodoc arguments."""
+	repoman_check_name = 'ebuild.minorsyn'
+	uselessdodoc_re = re.compile(
+		r'^\s*dodoc(\s+|\s+.*\s+)(ABOUT-NLS|COPYING|LICENCE|LICENSE)($|\s)')
+
+	def check(self, num, line):
+		match = self.uselessdodoc_re.match(line)
+		if match:
+			return "Useless dodoc '%s'" % (match.group(2), ) + " on line: %d"


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

* [gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/modules/linechecks/useless/
@ 2017-07-15  2:29 Brian Dolbec
  0 siblings, 0 replies; 9+ messages in thread
From: Brian Dolbec @ 2017-07-15  2:29 UTC (permalink / raw
  To: gentoo-commits

commit:     2b4ba2b10d9b4a1417b5f34a884aaad3b07a0a25
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 15 01:06:38 2017 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat Jul 15 02:25:45 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=2b4ba2b1

repoman: New linechecks module, useless

 .../repoman/modules/linechecks/useless/__init__.py | 27 ++++++++++++++++++++++
 .../pym/repoman/modules/linechecks/useless/cd.py   | 24 +++++++++++++++++++
 .../repoman/modules/linechecks/useless/dodoc.py    | 16 +++++++++++++
 3 files changed, 67 insertions(+)

diff --git a/repoman/pym/repoman/modules/linechecks/useless/__init__.py b/repoman/pym/repoman/modules/linechecks/useless/__init__.py
new file mode 100644
index 000000000..acc4479f5
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/useless/__init__.py
@@ -0,0 +1,27 @@
+# Copyright 2015-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+doc = """Useless plug-in module for repoman LineChecks.
+Performs checks for useless operations on ebuilds."""
+__doc__ = doc[:]
+
+
+module_spec = {
+	'name': 'do',
+	'description': doc,
+	'provides':{
+		'uselesscds-check': {
+			'name': "uselesscds",
+			'sourcefile': "cd",
+			'class': "EbuildUselessCdS",
+			'description': doc,
+		},
+		'uselessdodoc-check': {
+			'name': "uselessdodoc",
+			'sourcefile': "dodoc",
+			'class': "EbuildUselessDodoc",
+			'description': doc,
+		},
+	}
+}
+

diff --git a/repoman/pym/repoman/modules/linechecks/useless/cd.py b/repoman/pym/repoman/modules/linechecks/useless/cd.py
new file mode 100644
index 000000000..3daa04451
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/useless/cd.py
@@ -0,0 +1,24 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildUselessCdS(LineCheck):
+	"""Check for redundant cd ${S} statements"""
+	repoman_check_name = 'ebuild.minorsyn'
+	_src_phases = r'^\s*src_(prepare|configure|compile|install|test)\s*\(\)'
+	method_re = re.compile(_src_phases)
+	cds_re = re.compile(r'^\s*cd\s+("\$(\{S\}|S)"|\$(\{S\}|S))\s')
+
+	def __init__(self, errors):
+		self.errors = errors
+		self.check_next_line = False
+
+	def check(self, num, line):
+		if self.check_next_line:
+			self.check_next_line = False
+			if self.cds_re.match(line):
+				return self.errors['REDUNDANT_CD_S_ERROR']
+		elif self.method_re.match(line):
+			self.check_next_line = True

diff --git a/repoman/pym/repoman/modules/linechecks/useless/dodoc.py b/repoman/pym/repoman/modules/linechecks/useless/dodoc.py
new file mode 100644
index 000000000..502bfbea8
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/useless/dodoc.py
@@ -0,0 +1,16 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildUselessDodoc(LineCheck):
+	"""Check ebuild for useless files in dodoc arguments."""
+	repoman_check_name = 'ebuild.minorsyn'
+	uselessdodoc_re = re.compile(
+		r'^\s*dodoc(\s+|\s+.*\s+)(ABOUT-NLS|COPYING|LICENCE|LICENSE)($|\s)')
+
+	def check(self, num, line):
+		match = self.uselessdodoc_re.match(line)
+		if match:
+			return "Useless dodoc '%s'" % (match.group(2), ) + " on line: %d"


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

* [gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/modules/linechecks/useless/
@ 2017-09-11 21:43 Brian Dolbec
  0 siblings, 0 replies; 9+ messages in thread
From: Brian Dolbec @ 2017-09-11 21:43 UTC (permalink / raw
  To: gentoo-commits

commit:     5e555d2420a65507448c768b1aff7b34418fa9c6
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 15 01:06:38 2017 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 11 16:13:16 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=5e555d24

repoman: New linechecks module, useless

 .../repoman/modules/linechecks/useless/__init__.py | 27 ++++++++++++++++++++++
 .../pym/repoman/modules/linechecks/useless/cd.py   | 24 +++++++++++++++++++
 .../repoman/modules/linechecks/useless/dodoc.py    | 16 +++++++++++++
 3 files changed, 67 insertions(+)

diff --git a/repoman/pym/repoman/modules/linechecks/useless/__init__.py b/repoman/pym/repoman/modules/linechecks/useless/__init__.py
new file mode 100644
index 000000000..acc4479f5
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/useless/__init__.py
@@ -0,0 +1,27 @@
+# Copyright 2015-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+doc = """Useless plug-in module for repoman LineChecks.
+Performs checks for useless operations on ebuilds."""
+__doc__ = doc[:]
+
+
+module_spec = {
+	'name': 'do',
+	'description': doc,
+	'provides':{
+		'uselesscds-check': {
+			'name': "uselesscds",
+			'sourcefile': "cd",
+			'class': "EbuildUselessCdS",
+			'description': doc,
+		},
+		'uselessdodoc-check': {
+			'name': "uselessdodoc",
+			'sourcefile': "dodoc",
+			'class': "EbuildUselessDodoc",
+			'description': doc,
+		},
+	}
+}
+

diff --git a/repoman/pym/repoman/modules/linechecks/useless/cd.py b/repoman/pym/repoman/modules/linechecks/useless/cd.py
new file mode 100644
index 000000000..3daa04451
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/useless/cd.py
@@ -0,0 +1,24 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildUselessCdS(LineCheck):
+	"""Check for redundant cd ${S} statements"""
+	repoman_check_name = 'ebuild.minorsyn'
+	_src_phases = r'^\s*src_(prepare|configure|compile|install|test)\s*\(\)'
+	method_re = re.compile(_src_phases)
+	cds_re = re.compile(r'^\s*cd\s+("\$(\{S\}|S)"|\$(\{S\}|S))\s')
+
+	def __init__(self, errors):
+		self.errors = errors
+		self.check_next_line = False
+
+	def check(self, num, line):
+		if self.check_next_line:
+			self.check_next_line = False
+			if self.cds_re.match(line):
+				return self.errors['REDUNDANT_CD_S_ERROR']
+		elif self.method_re.match(line):
+			self.check_next_line = True

diff --git a/repoman/pym/repoman/modules/linechecks/useless/dodoc.py b/repoman/pym/repoman/modules/linechecks/useless/dodoc.py
new file mode 100644
index 000000000..502bfbea8
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/useless/dodoc.py
@@ -0,0 +1,16 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildUselessDodoc(LineCheck):
+	"""Check ebuild for useless files in dodoc arguments."""
+	repoman_check_name = 'ebuild.minorsyn'
+	uselessdodoc_re = re.compile(
+		r'^\s*dodoc(\s+|\s+.*\s+)(ABOUT-NLS|COPYING|LICENCE|LICENSE)($|\s)')
+
+	def check(self, num, line):
+		match = self.uselessdodoc_re.match(line)
+		if match:
+			return "Useless dodoc '%s'" % (match.group(2), ) + " on line: %d"


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

* [gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/modules/linechecks/useless/
@ 2017-11-26 17:46 Brian Dolbec
  0 siblings, 0 replies; 9+ messages in thread
From: Brian Dolbec @ 2017-11-26 17:46 UTC (permalink / raw
  To: gentoo-commits

commit:     249b44588e0aaca82d0eccbdcc0af3372c8cb63f
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 15 01:06:38 2017 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sun Nov 26 17:32:20 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=249b4458

repoman: New linechecks module, useless

 .../repoman/modules/linechecks/useless/__init__.py | 27 ++++++++++++++++++++++
 .../pym/repoman/modules/linechecks/useless/cd.py   | 24 +++++++++++++++++++
 .../repoman/modules/linechecks/useless/dodoc.py    | 16 +++++++++++++
 3 files changed, 67 insertions(+)

diff --git a/repoman/pym/repoman/modules/linechecks/useless/__init__.py b/repoman/pym/repoman/modules/linechecks/useless/__init__.py
new file mode 100644
index 000000000..acc4479f5
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/useless/__init__.py
@@ -0,0 +1,27 @@
+# Copyright 2015-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+doc = """Useless plug-in module for repoman LineChecks.
+Performs checks for useless operations on ebuilds."""
+__doc__ = doc[:]
+
+
+module_spec = {
+	'name': 'do',
+	'description': doc,
+	'provides':{
+		'uselesscds-check': {
+			'name': "uselesscds",
+			'sourcefile': "cd",
+			'class': "EbuildUselessCdS",
+			'description': doc,
+		},
+		'uselessdodoc-check': {
+			'name': "uselessdodoc",
+			'sourcefile': "dodoc",
+			'class': "EbuildUselessDodoc",
+			'description': doc,
+		},
+	}
+}
+

diff --git a/repoman/pym/repoman/modules/linechecks/useless/cd.py b/repoman/pym/repoman/modules/linechecks/useless/cd.py
new file mode 100644
index 000000000..3daa04451
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/useless/cd.py
@@ -0,0 +1,24 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildUselessCdS(LineCheck):
+	"""Check for redundant cd ${S} statements"""
+	repoman_check_name = 'ebuild.minorsyn'
+	_src_phases = r'^\s*src_(prepare|configure|compile|install|test)\s*\(\)'
+	method_re = re.compile(_src_phases)
+	cds_re = re.compile(r'^\s*cd\s+("\$(\{S\}|S)"|\$(\{S\}|S))\s')
+
+	def __init__(self, errors):
+		self.errors = errors
+		self.check_next_line = False
+
+	def check(self, num, line):
+		if self.check_next_line:
+			self.check_next_line = False
+			if self.cds_re.match(line):
+				return self.errors['REDUNDANT_CD_S_ERROR']
+		elif self.method_re.match(line):
+			self.check_next_line = True

diff --git a/repoman/pym/repoman/modules/linechecks/useless/dodoc.py b/repoman/pym/repoman/modules/linechecks/useless/dodoc.py
new file mode 100644
index 000000000..502bfbea8
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/useless/dodoc.py
@@ -0,0 +1,16 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildUselessDodoc(LineCheck):
+	"""Check ebuild for useless files in dodoc arguments."""
+	repoman_check_name = 'ebuild.minorsyn'
+	uselessdodoc_re = re.compile(
+		r'^\s*dodoc(\s+|\s+.*\s+)(ABOUT-NLS|COPYING|LICENCE|LICENSE)($|\s)')
+
+	def check(self, num, line):
+		match = self.uselessdodoc_re.match(line)
+		if match:
+			return "Useless dodoc '%s'" % (match.group(2), ) + " on line: %d"


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

* [gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/modules/linechecks/useless/
@ 2017-12-05 18:32 Brian Dolbec
  0 siblings, 0 replies; 9+ messages in thread
From: Brian Dolbec @ 2017-12-05 18:32 UTC (permalink / raw
  To: gentoo-commits

commit:     463d5a7c33f8639e38b48c1947ca1b1f9ae9480e
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 15 01:06:38 2017 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Tue Dec  5 18:24:49 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=463d5a7c

repoman: New linechecks module, useless

 .../repoman/modules/linechecks/useless/__init__.py | 27 ++++++++++++++++++++++
 .../pym/repoman/modules/linechecks/useless/cd.py   | 24 +++++++++++++++++++
 .../repoman/modules/linechecks/useless/dodoc.py    | 16 +++++++++++++
 3 files changed, 67 insertions(+)

diff --git a/repoman/pym/repoman/modules/linechecks/useless/__init__.py b/repoman/pym/repoman/modules/linechecks/useless/__init__.py
new file mode 100644
index 000000000..acc4479f5
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/useless/__init__.py
@@ -0,0 +1,27 @@
+# Copyright 2015-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+doc = """Useless plug-in module for repoman LineChecks.
+Performs checks for useless operations on ebuilds."""
+__doc__ = doc[:]
+
+
+module_spec = {
+	'name': 'do',
+	'description': doc,
+	'provides':{
+		'uselesscds-check': {
+			'name': "uselesscds",
+			'sourcefile': "cd",
+			'class': "EbuildUselessCdS",
+			'description': doc,
+		},
+		'uselessdodoc-check': {
+			'name': "uselessdodoc",
+			'sourcefile': "dodoc",
+			'class': "EbuildUselessDodoc",
+			'description': doc,
+		},
+	}
+}
+

diff --git a/repoman/pym/repoman/modules/linechecks/useless/cd.py b/repoman/pym/repoman/modules/linechecks/useless/cd.py
new file mode 100644
index 000000000..3daa04451
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/useless/cd.py
@@ -0,0 +1,24 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildUselessCdS(LineCheck):
+	"""Check for redundant cd ${S} statements"""
+	repoman_check_name = 'ebuild.minorsyn'
+	_src_phases = r'^\s*src_(prepare|configure|compile|install|test)\s*\(\)'
+	method_re = re.compile(_src_phases)
+	cds_re = re.compile(r'^\s*cd\s+("\$(\{S\}|S)"|\$(\{S\}|S))\s')
+
+	def __init__(self, errors):
+		self.errors = errors
+		self.check_next_line = False
+
+	def check(self, num, line):
+		if self.check_next_line:
+			self.check_next_line = False
+			if self.cds_re.match(line):
+				return self.errors['REDUNDANT_CD_S_ERROR']
+		elif self.method_re.match(line):
+			self.check_next_line = True

diff --git a/repoman/pym/repoman/modules/linechecks/useless/dodoc.py b/repoman/pym/repoman/modules/linechecks/useless/dodoc.py
new file mode 100644
index 000000000..502bfbea8
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/useless/dodoc.py
@@ -0,0 +1,16 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildUselessDodoc(LineCheck):
+	"""Check ebuild for useless files in dodoc arguments."""
+	repoman_check_name = 'ebuild.minorsyn'
+	uselessdodoc_re = re.compile(
+		r'^\s*dodoc(\s+|\s+.*\s+)(ABOUT-NLS|COPYING|LICENCE|LICENSE)($|\s)')
+
+	def check(self, num, line):
+		match = self.uselessdodoc_re.match(line)
+		if match:
+			return "Useless dodoc '%s'" % (match.group(2), ) + " on line: %d"


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

* [gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/modules/linechecks/useless/
@ 2017-12-06  0:16 Brian Dolbec
  0 siblings, 0 replies; 9+ messages in thread
From: Brian Dolbec @ 2017-12-06  0:16 UTC (permalink / raw
  To: gentoo-commits

commit:     8fe18fb17a553601a73e0bf0cfdf54d34f3726ba
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 15 01:06:38 2017 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Wed Dec  6 00:13:27 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=8fe18fb1

repoman: New linechecks module, useless

 .../repoman/modules/linechecks/useless/__init__.py | 27 ++++++++++++++++++++++
 .../pym/repoman/modules/linechecks/useless/cd.py   | 24 +++++++++++++++++++
 .../repoman/modules/linechecks/useless/dodoc.py    | 16 +++++++++++++
 3 files changed, 67 insertions(+)

diff --git a/repoman/pym/repoman/modules/linechecks/useless/__init__.py b/repoman/pym/repoman/modules/linechecks/useless/__init__.py
new file mode 100644
index 000000000..acc4479f5
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/useless/__init__.py
@@ -0,0 +1,27 @@
+# Copyright 2015-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+doc = """Useless plug-in module for repoman LineChecks.
+Performs checks for useless operations on ebuilds."""
+__doc__ = doc[:]
+
+
+module_spec = {
+	'name': 'do',
+	'description': doc,
+	'provides':{
+		'uselesscds-check': {
+			'name': "uselesscds",
+			'sourcefile': "cd",
+			'class': "EbuildUselessCdS",
+			'description': doc,
+		},
+		'uselessdodoc-check': {
+			'name': "uselessdodoc",
+			'sourcefile': "dodoc",
+			'class': "EbuildUselessDodoc",
+			'description': doc,
+		},
+	}
+}
+

diff --git a/repoman/pym/repoman/modules/linechecks/useless/cd.py b/repoman/pym/repoman/modules/linechecks/useless/cd.py
new file mode 100644
index 000000000..3daa04451
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/useless/cd.py
@@ -0,0 +1,24 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildUselessCdS(LineCheck):
+	"""Check for redundant cd ${S} statements"""
+	repoman_check_name = 'ebuild.minorsyn'
+	_src_phases = r'^\s*src_(prepare|configure|compile|install|test)\s*\(\)'
+	method_re = re.compile(_src_phases)
+	cds_re = re.compile(r'^\s*cd\s+("\$(\{S\}|S)"|\$(\{S\}|S))\s')
+
+	def __init__(self, errors):
+		self.errors = errors
+		self.check_next_line = False
+
+	def check(self, num, line):
+		if self.check_next_line:
+			self.check_next_line = False
+			if self.cds_re.match(line):
+				return self.errors['REDUNDANT_CD_S_ERROR']
+		elif self.method_re.match(line):
+			self.check_next_line = True

diff --git a/repoman/pym/repoman/modules/linechecks/useless/dodoc.py b/repoman/pym/repoman/modules/linechecks/useless/dodoc.py
new file mode 100644
index 000000000..502bfbea8
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/useless/dodoc.py
@@ -0,0 +1,16 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildUselessDodoc(LineCheck):
+	"""Check ebuild for useless files in dodoc arguments."""
+	repoman_check_name = 'ebuild.minorsyn'
+	uselessdodoc_re = re.compile(
+		r'^\s*dodoc(\s+|\s+.*\s+)(ABOUT-NLS|COPYING|LICENCE|LICENSE)($|\s)')
+
+	def check(self, num, line):
+		match = self.uselessdodoc_re.match(line)
+		if match:
+			return "Useless dodoc '%s'" % (match.group(2), ) + " on line: %d"


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

* [gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/modules/linechecks/useless/
@ 2018-03-29 21:35 Brian Dolbec
  0 siblings, 0 replies; 9+ messages in thread
From: Brian Dolbec @ 2018-03-29 21:35 UTC (permalink / raw
  To: gentoo-commits

commit:     588d47fd91ed5637d6a641d1e2ef39b80b5780f8
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 15 01:06:38 2017 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Thu Mar 29 20:43:39 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=588d47fd

repoman: New linechecks module, useless

 .../repoman/modules/linechecks/useless/__init__.py | 27 ++++++++++++++++++++++
 .../pym/repoman/modules/linechecks/useless/cd.py   | 24 +++++++++++++++++++
 .../repoman/modules/linechecks/useless/dodoc.py    | 16 +++++++++++++
 3 files changed, 67 insertions(+)

diff --git a/repoman/pym/repoman/modules/linechecks/useless/__init__.py b/repoman/pym/repoman/modules/linechecks/useless/__init__.py
new file mode 100644
index 000000000..acc4479f5
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/useless/__init__.py
@@ -0,0 +1,27 @@
+# Copyright 2015-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+doc = """Useless plug-in module for repoman LineChecks.
+Performs checks for useless operations on ebuilds."""
+__doc__ = doc[:]
+
+
+module_spec = {
+	'name': 'do',
+	'description': doc,
+	'provides':{
+		'uselesscds-check': {
+			'name': "uselesscds",
+			'sourcefile': "cd",
+			'class': "EbuildUselessCdS",
+			'description': doc,
+		},
+		'uselessdodoc-check': {
+			'name': "uselessdodoc",
+			'sourcefile': "dodoc",
+			'class': "EbuildUselessDodoc",
+			'description': doc,
+		},
+	}
+}
+

diff --git a/repoman/pym/repoman/modules/linechecks/useless/cd.py b/repoman/pym/repoman/modules/linechecks/useless/cd.py
new file mode 100644
index 000000000..3daa04451
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/useless/cd.py
@@ -0,0 +1,24 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildUselessCdS(LineCheck):
+	"""Check for redundant cd ${S} statements"""
+	repoman_check_name = 'ebuild.minorsyn'
+	_src_phases = r'^\s*src_(prepare|configure|compile|install|test)\s*\(\)'
+	method_re = re.compile(_src_phases)
+	cds_re = re.compile(r'^\s*cd\s+("\$(\{S\}|S)"|\$(\{S\}|S))\s')
+
+	def __init__(self, errors):
+		self.errors = errors
+		self.check_next_line = False
+
+	def check(self, num, line):
+		if self.check_next_line:
+			self.check_next_line = False
+			if self.cds_re.match(line):
+				return self.errors['REDUNDANT_CD_S_ERROR']
+		elif self.method_re.match(line):
+			self.check_next_line = True

diff --git a/repoman/pym/repoman/modules/linechecks/useless/dodoc.py b/repoman/pym/repoman/modules/linechecks/useless/dodoc.py
new file mode 100644
index 000000000..502bfbea8
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/useless/dodoc.py
@@ -0,0 +1,16 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildUselessDodoc(LineCheck):
+	"""Check ebuild for useless files in dodoc arguments."""
+	repoman_check_name = 'ebuild.minorsyn'
+	uselessdodoc_re = re.compile(
+		r'^\s*dodoc(\s+|\s+.*\s+)(ABOUT-NLS|COPYING|LICENCE|LICENSE)($|\s)')
+
+	def check(self, num, line):
+		match = self.uselessdodoc_re.match(line)
+		if match:
+			return "Useless dodoc '%s'" % (match.group(2), ) + " on line: %d"


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

* [gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/modules/linechecks/useless/
@ 2018-03-30  0:48 Brian Dolbec
  0 siblings, 0 replies; 9+ messages in thread
From: Brian Dolbec @ 2018-03-30  0:48 UTC (permalink / raw
  To: gentoo-commits

commit:     3992e59c9ff60cbd25b60d7bf4e47b09b845aba1
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 15 01:06:38 2017 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Fri Mar 30 00:43:46 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=3992e59c

repoman: New linechecks module, useless

 .../repoman/modules/linechecks/useless/__init__.py | 27 ++++++++++++++++++++++
 .../pym/repoman/modules/linechecks/useless/cd.py   | 24 +++++++++++++++++++
 .../repoman/modules/linechecks/useless/dodoc.py    | 16 +++++++++++++
 3 files changed, 67 insertions(+)

diff --git a/repoman/pym/repoman/modules/linechecks/useless/__init__.py b/repoman/pym/repoman/modules/linechecks/useless/__init__.py
new file mode 100644
index 000000000..acc4479f5
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/useless/__init__.py
@@ -0,0 +1,27 @@
+# Copyright 2015-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+doc = """Useless plug-in module for repoman LineChecks.
+Performs checks for useless operations on ebuilds."""
+__doc__ = doc[:]
+
+
+module_spec = {
+	'name': 'do',
+	'description': doc,
+	'provides':{
+		'uselesscds-check': {
+			'name': "uselesscds",
+			'sourcefile': "cd",
+			'class': "EbuildUselessCdS",
+			'description': doc,
+		},
+		'uselessdodoc-check': {
+			'name': "uselessdodoc",
+			'sourcefile': "dodoc",
+			'class': "EbuildUselessDodoc",
+			'description': doc,
+		},
+	}
+}
+

diff --git a/repoman/pym/repoman/modules/linechecks/useless/cd.py b/repoman/pym/repoman/modules/linechecks/useless/cd.py
new file mode 100644
index 000000000..3daa04451
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/useless/cd.py
@@ -0,0 +1,24 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildUselessCdS(LineCheck):
+	"""Check for redundant cd ${S} statements"""
+	repoman_check_name = 'ebuild.minorsyn'
+	_src_phases = r'^\s*src_(prepare|configure|compile|install|test)\s*\(\)'
+	method_re = re.compile(_src_phases)
+	cds_re = re.compile(r'^\s*cd\s+("\$(\{S\}|S)"|\$(\{S\}|S))\s')
+
+	def __init__(self, errors):
+		self.errors = errors
+		self.check_next_line = False
+
+	def check(self, num, line):
+		if self.check_next_line:
+			self.check_next_line = False
+			if self.cds_re.match(line):
+				return self.errors['REDUNDANT_CD_S_ERROR']
+		elif self.method_re.match(line):
+			self.check_next_line = True

diff --git a/repoman/pym/repoman/modules/linechecks/useless/dodoc.py b/repoman/pym/repoman/modules/linechecks/useless/dodoc.py
new file mode 100644
index 000000000..502bfbea8
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/useless/dodoc.py
@@ -0,0 +1,16 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildUselessDodoc(LineCheck):
+	"""Check ebuild for useless files in dodoc arguments."""
+	repoman_check_name = 'ebuild.minorsyn'
+	uselessdodoc_re = re.compile(
+		r'^\s*dodoc(\s+|\s+.*\s+)(ABOUT-NLS|COPYING|LICENCE|LICENSE)($|\s)')
+
+	def check(self, num, line):
+		match = self.uselessdodoc_re.match(line)
+		if match:
+			return "Useless dodoc '%s'" % (match.group(2), ) + " on line: %d"


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

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

commit:     340283538afc734790341c78a09742bcd0fc1009
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 15 01:06:38 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Mar 30 03:51:19 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=34028353

repoman: New linechecks module, useless

 .../repoman/modules/linechecks/useless/__init__.py | 27 ++++++++++++++++++++++
 .../pym/repoman/modules/linechecks/useless/cd.py   | 24 +++++++++++++++++++
 .../repoman/modules/linechecks/useless/dodoc.py    | 16 +++++++++++++
 3 files changed, 67 insertions(+)

diff --git a/repoman/pym/repoman/modules/linechecks/useless/__init__.py b/repoman/pym/repoman/modules/linechecks/useless/__init__.py
new file mode 100644
index 000000000..acc4479f5
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/useless/__init__.py
@@ -0,0 +1,27 @@
+# Copyright 2015-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+doc = """Useless plug-in module for repoman LineChecks.
+Performs checks for useless operations on ebuilds."""
+__doc__ = doc[:]
+
+
+module_spec = {
+	'name': 'do',
+	'description': doc,
+	'provides':{
+		'uselesscds-check': {
+			'name': "uselesscds",
+			'sourcefile': "cd",
+			'class': "EbuildUselessCdS",
+			'description': doc,
+		},
+		'uselessdodoc-check': {
+			'name': "uselessdodoc",
+			'sourcefile': "dodoc",
+			'class': "EbuildUselessDodoc",
+			'description': doc,
+		},
+	}
+}
+

diff --git a/repoman/pym/repoman/modules/linechecks/useless/cd.py b/repoman/pym/repoman/modules/linechecks/useless/cd.py
new file mode 100644
index 000000000..3daa04451
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/useless/cd.py
@@ -0,0 +1,24 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildUselessCdS(LineCheck):
+	"""Check for redundant cd ${S} statements"""
+	repoman_check_name = 'ebuild.minorsyn'
+	_src_phases = r'^\s*src_(prepare|configure|compile|install|test)\s*\(\)'
+	method_re = re.compile(_src_phases)
+	cds_re = re.compile(r'^\s*cd\s+("\$(\{S\}|S)"|\$(\{S\}|S))\s')
+
+	def __init__(self, errors):
+		self.errors = errors
+		self.check_next_line = False
+
+	def check(self, num, line):
+		if self.check_next_line:
+			self.check_next_line = False
+			if self.cds_re.match(line):
+				return self.errors['REDUNDANT_CD_S_ERROR']
+		elif self.method_re.match(line):
+			self.check_next_line = True

diff --git a/repoman/pym/repoman/modules/linechecks/useless/dodoc.py b/repoman/pym/repoman/modules/linechecks/useless/dodoc.py
new file mode 100644
index 000000000..502bfbea8
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/useless/dodoc.py
@@ -0,0 +1,16 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildUselessDodoc(LineCheck):
+	"""Check ebuild for useless files in dodoc arguments."""
+	repoman_check_name = 'ebuild.minorsyn'
+	uselessdodoc_re = re.compile(
+		r'^\s*dodoc(\s+|\s+.*\s+)(ABOUT-NLS|COPYING|LICENCE|LICENSE)($|\s)')
+
+	def check(self, num, line):
+		match = self.uselessdodoc_re.match(line)
+		if match:
+			return "Useless dodoc '%s'" % (match.group(2), ) + " on line: %d"


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

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

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-15  2:08 [gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/modules/linechecks/useless/ Brian Dolbec
  -- strict thread matches above, loose matches on Subject: below --
2017-07-15  2:29 Brian Dolbec
2017-09-11 21:43 Brian Dolbec
2017-11-26 17:46 Brian Dolbec
2017-12-05 18:32 Brian Dolbec
2017-12-06  0:16 Brian Dolbec
2018-03-29 21:35 Brian Dolbec
2018-03-30  0:48 Brian Dolbec
2018-03-30  5:20 Zac Medico

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