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/whitespace/
@ 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:     9aa219b2b12bc885a55f14d52ca815b8be0a0946
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 15 01:07:13 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=9aa219b2

repoman: New linechecks module, whitespace

 .../modules/linechecks/whitespace/__init__.py      | 27 ++++++++++++++++++++++
 .../repoman/modules/linechecks/whitespace/blank.py | 25 ++++++++++++++++++++
 .../modules/linechecks/whitespace/whitespace.py    | 21 +++++++++++++++++
 3 files changed, 73 insertions(+)

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

diff --git a/repoman/pym/repoman/modules/linechecks/whitespace/blank.py b/repoman/pym/repoman/modules/linechecks/whitespace/blank.py
new file mode 100644
index 000000000..2ab4097a3
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/whitespace/blank.py
@@ -0,0 +1,25 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildBlankLine(LineCheck):
+	repoman_check_name = 'ebuild.minorsyn'
+	ignore_comment = False
+	blank_line = re.compile(r'^$')
+
+	def new(self, pkg):
+		self.line_is_blank = False
+
+	def check(self, num, line):
+		if self.line_is_blank and self.blank_line.match(line):
+			return 'Useless blank line on line: %d'
+		if self.blank_line.match(line):
+			self.line_is_blank = True
+		else:
+			self.line_is_blank = False
+
+	def end(self):
+		if self.line_is_blank:
+			yield 'Useless blank line on last line'

diff --git a/repoman/pym/repoman/modules/linechecks/whitespace/whitespace.py b/repoman/pym/repoman/modules/linechecks/whitespace/whitespace.py
new file mode 100644
index 000000000..556b2ab81
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/whitespace/whitespace.py
@@ -0,0 +1,21 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildWhitespace(LineCheck):
+	"""Ensure ebuilds have proper whitespacing"""
+
+	repoman_check_name = 'ebuild.minorsyn'
+
+	ignore_line = re.compile(r'(^$)|(^(\t)*#)')
+	ignore_comment = False
+	leading_spaces = re.compile(r'^[\S\t]')
+	trailing_whitespace = re.compile(r'.*([\S]$)')
+
+	def check(self, num, line):
+		if self.leading_spaces.match(line) is None:
+			return self.errors['LEADING_SPACES_ERROR']
+		if self.trailing_whitespace.match(line) is None:
+			return self.errors['TRAILING_WHITESPACE_ERROR']


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

* [gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/modules/linechecks/whitespace/
@ 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:     ad99abe856fd08043e24736ffef4579fd0597569
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 15 01:07:13 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=ad99abe8

repoman: New linechecks module, whitespace

 .../modules/linechecks/whitespace/__init__.py      | 27 ++++++++++++++++++++++
 .../repoman/modules/linechecks/whitespace/blank.py | 25 ++++++++++++++++++++
 .../modules/linechecks/whitespace/whitespace.py    | 21 +++++++++++++++++
 3 files changed, 73 insertions(+)

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

diff --git a/repoman/pym/repoman/modules/linechecks/whitespace/blank.py b/repoman/pym/repoman/modules/linechecks/whitespace/blank.py
new file mode 100644
index 000000000..2ab4097a3
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/whitespace/blank.py
@@ -0,0 +1,25 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildBlankLine(LineCheck):
+	repoman_check_name = 'ebuild.minorsyn'
+	ignore_comment = False
+	blank_line = re.compile(r'^$')
+
+	def new(self, pkg):
+		self.line_is_blank = False
+
+	def check(self, num, line):
+		if self.line_is_blank and self.blank_line.match(line):
+			return 'Useless blank line on line: %d'
+		if self.blank_line.match(line):
+			self.line_is_blank = True
+		else:
+			self.line_is_blank = False
+
+	def end(self):
+		if self.line_is_blank:
+			yield 'Useless blank line on last line'

diff --git a/repoman/pym/repoman/modules/linechecks/whitespace/whitespace.py b/repoman/pym/repoman/modules/linechecks/whitespace/whitespace.py
new file mode 100644
index 000000000..556b2ab81
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/whitespace/whitespace.py
@@ -0,0 +1,21 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildWhitespace(LineCheck):
+	"""Ensure ebuilds have proper whitespacing"""
+
+	repoman_check_name = 'ebuild.minorsyn'
+
+	ignore_line = re.compile(r'(^$)|(^(\t)*#)')
+	ignore_comment = False
+	leading_spaces = re.compile(r'^[\S\t]')
+	trailing_whitespace = re.compile(r'.*([\S]$)')
+
+	def check(self, num, line):
+		if self.leading_spaces.match(line) is None:
+			return self.errors['LEADING_SPACES_ERROR']
+		if self.trailing_whitespace.match(line) is None:
+			return self.errors['TRAILING_WHITESPACE_ERROR']


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

* [gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/modules/linechecks/whitespace/
@ 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:     fdf9a1391c77abbf6dd553e92013e54be9a82f53
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 15 01:07:13 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=fdf9a139

repoman: New linechecks module, whitespace

 .../modules/linechecks/whitespace/__init__.py      | 27 ++++++++++++++++++++++
 .../repoman/modules/linechecks/whitespace/blank.py | 25 ++++++++++++++++++++
 .../modules/linechecks/whitespace/whitespace.py    | 21 +++++++++++++++++
 3 files changed, 73 insertions(+)

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

diff --git a/repoman/pym/repoman/modules/linechecks/whitespace/blank.py b/repoman/pym/repoman/modules/linechecks/whitespace/blank.py
new file mode 100644
index 000000000..2ab4097a3
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/whitespace/blank.py
@@ -0,0 +1,25 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildBlankLine(LineCheck):
+	repoman_check_name = 'ebuild.minorsyn'
+	ignore_comment = False
+	blank_line = re.compile(r'^$')
+
+	def new(self, pkg):
+		self.line_is_blank = False
+
+	def check(self, num, line):
+		if self.line_is_blank and self.blank_line.match(line):
+			return 'Useless blank line on line: %d'
+		if self.blank_line.match(line):
+			self.line_is_blank = True
+		else:
+			self.line_is_blank = False
+
+	def end(self):
+		if self.line_is_blank:
+			yield 'Useless blank line on last line'

diff --git a/repoman/pym/repoman/modules/linechecks/whitespace/whitespace.py b/repoman/pym/repoman/modules/linechecks/whitespace/whitespace.py
new file mode 100644
index 000000000..556b2ab81
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/whitespace/whitespace.py
@@ -0,0 +1,21 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildWhitespace(LineCheck):
+	"""Ensure ebuilds have proper whitespacing"""
+
+	repoman_check_name = 'ebuild.minorsyn'
+
+	ignore_line = re.compile(r'(^$)|(^(\t)*#)')
+	ignore_comment = False
+	leading_spaces = re.compile(r'^[\S\t]')
+	trailing_whitespace = re.compile(r'.*([\S]$)')
+
+	def check(self, num, line):
+		if self.leading_spaces.match(line) is None:
+			return self.errors['LEADING_SPACES_ERROR']
+		if self.trailing_whitespace.match(line) is None:
+			return self.errors['TRAILING_WHITESPACE_ERROR']


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

* [gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/modules/linechecks/whitespace/
@ 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:     c960e7e9440fa63bd3b84a34658ecf0923a9dcdd
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 15 01:07:13 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=c960e7e9

repoman: New linechecks module, whitespace

 .../modules/linechecks/whitespace/__init__.py      | 27 ++++++++++++++++++++++
 .../repoman/modules/linechecks/whitespace/blank.py | 25 ++++++++++++++++++++
 .../modules/linechecks/whitespace/whitespace.py    | 21 +++++++++++++++++
 3 files changed, 73 insertions(+)

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

diff --git a/repoman/pym/repoman/modules/linechecks/whitespace/blank.py b/repoman/pym/repoman/modules/linechecks/whitespace/blank.py
new file mode 100644
index 000000000..2ab4097a3
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/whitespace/blank.py
@@ -0,0 +1,25 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildBlankLine(LineCheck):
+	repoman_check_name = 'ebuild.minorsyn'
+	ignore_comment = False
+	blank_line = re.compile(r'^$')
+
+	def new(self, pkg):
+		self.line_is_blank = False
+
+	def check(self, num, line):
+		if self.line_is_blank and self.blank_line.match(line):
+			return 'Useless blank line on line: %d'
+		if self.blank_line.match(line):
+			self.line_is_blank = True
+		else:
+			self.line_is_blank = False
+
+	def end(self):
+		if self.line_is_blank:
+			yield 'Useless blank line on last line'

diff --git a/repoman/pym/repoman/modules/linechecks/whitespace/whitespace.py b/repoman/pym/repoman/modules/linechecks/whitespace/whitespace.py
new file mode 100644
index 000000000..556b2ab81
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/whitespace/whitespace.py
@@ -0,0 +1,21 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildWhitespace(LineCheck):
+	"""Ensure ebuilds have proper whitespacing"""
+
+	repoman_check_name = 'ebuild.minorsyn'
+
+	ignore_line = re.compile(r'(^$)|(^(\t)*#)')
+	ignore_comment = False
+	leading_spaces = re.compile(r'^[\S\t]')
+	trailing_whitespace = re.compile(r'.*([\S]$)')
+
+	def check(self, num, line):
+		if self.leading_spaces.match(line) is None:
+			return self.errors['LEADING_SPACES_ERROR']
+		if self.trailing_whitespace.match(line) is None:
+			return self.errors['TRAILING_WHITESPACE_ERROR']


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

* [gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/modules/linechecks/whitespace/
@ 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:     58486c7f12b971460e0efc1a037fe7cd1a9904ac
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 15 01:07:13 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=58486c7f

repoman: New linechecks module, whitespace

 .../modules/linechecks/whitespace/__init__.py      | 27 ++++++++++++++++++++++
 .../repoman/modules/linechecks/whitespace/blank.py | 25 ++++++++++++++++++++
 .../modules/linechecks/whitespace/whitespace.py    | 21 +++++++++++++++++
 3 files changed, 73 insertions(+)

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

diff --git a/repoman/pym/repoman/modules/linechecks/whitespace/blank.py b/repoman/pym/repoman/modules/linechecks/whitespace/blank.py
new file mode 100644
index 000000000..2ab4097a3
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/whitespace/blank.py
@@ -0,0 +1,25 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildBlankLine(LineCheck):
+	repoman_check_name = 'ebuild.minorsyn'
+	ignore_comment = False
+	blank_line = re.compile(r'^$')
+
+	def new(self, pkg):
+		self.line_is_blank = False
+
+	def check(self, num, line):
+		if self.line_is_blank and self.blank_line.match(line):
+			return 'Useless blank line on line: %d'
+		if self.blank_line.match(line):
+			self.line_is_blank = True
+		else:
+			self.line_is_blank = False
+
+	def end(self):
+		if self.line_is_blank:
+			yield 'Useless blank line on last line'

diff --git a/repoman/pym/repoman/modules/linechecks/whitespace/whitespace.py b/repoman/pym/repoman/modules/linechecks/whitespace/whitespace.py
new file mode 100644
index 000000000..556b2ab81
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/whitespace/whitespace.py
@@ -0,0 +1,21 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildWhitespace(LineCheck):
+	"""Ensure ebuilds have proper whitespacing"""
+
+	repoman_check_name = 'ebuild.minorsyn'
+
+	ignore_line = re.compile(r'(^$)|(^(\t)*#)')
+	ignore_comment = False
+	leading_spaces = re.compile(r'^[\S\t]')
+	trailing_whitespace = re.compile(r'.*([\S]$)')
+
+	def check(self, num, line):
+		if self.leading_spaces.match(line) is None:
+			return self.errors['LEADING_SPACES_ERROR']
+		if self.trailing_whitespace.match(line) is None:
+			return self.errors['TRAILING_WHITESPACE_ERROR']


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

* [gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/modules/linechecks/whitespace/
@ 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:     2b82ca71f0d297a375ff257f3bb18dcd14fc063c
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 15 01:07:13 2017 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Wed Dec  6 00:13:28 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=2b82ca71

repoman: New linechecks module, whitespace

 .../modules/linechecks/whitespace/__init__.py      | 27 ++++++++++++++++++++++
 .../repoman/modules/linechecks/whitespace/blank.py | 25 ++++++++++++++++++++
 .../modules/linechecks/whitespace/whitespace.py    | 21 +++++++++++++++++
 3 files changed, 73 insertions(+)

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

diff --git a/repoman/pym/repoman/modules/linechecks/whitespace/blank.py b/repoman/pym/repoman/modules/linechecks/whitespace/blank.py
new file mode 100644
index 000000000..2ab4097a3
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/whitespace/blank.py
@@ -0,0 +1,25 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildBlankLine(LineCheck):
+	repoman_check_name = 'ebuild.minorsyn'
+	ignore_comment = False
+	blank_line = re.compile(r'^$')
+
+	def new(self, pkg):
+		self.line_is_blank = False
+
+	def check(self, num, line):
+		if self.line_is_blank and self.blank_line.match(line):
+			return 'Useless blank line on line: %d'
+		if self.blank_line.match(line):
+			self.line_is_blank = True
+		else:
+			self.line_is_blank = False
+
+	def end(self):
+		if self.line_is_blank:
+			yield 'Useless blank line on last line'

diff --git a/repoman/pym/repoman/modules/linechecks/whitespace/whitespace.py b/repoman/pym/repoman/modules/linechecks/whitespace/whitespace.py
new file mode 100644
index 000000000..556b2ab81
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/whitespace/whitespace.py
@@ -0,0 +1,21 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildWhitespace(LineCheck):
+	"""Ensure ebuilds have proper whitespacing"""
+
+	repoman_check_name = 'ebuild.minorsyn'
+
+	ignore_line = re.compile(r'(^$)|(^(\t)*#)')
+	ignore_comment = False
+	leading_spaces = re.compile(r'^[\S\t]')
+	trailing_whitespace = re.compile(r'.*([\S]$)')
+
+	def check(self, num, line):
+		if self.leading_spaces.match(line) is None:
+			return self.errors['LEADING_SPACES_ERROR']
+		if self.trailing_whitespace.match(line) is None:
+			return self.errors['TRAILING_WHITESPACE_ERROR']


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

* [gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/modules/linechecks/whitespace/
@ 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:     9f4cd5889130f9bb3f738873986a53175deac9e6
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 15 01:07:13 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=9f4cd588

repoman: New linechecks module, whitespace

 .../modules/linechecks/whitespace/__init__.py      | 27 ++++++++++++++++++++++
 .../repoman/modules/linechecks/whitespace/blank.py | 25 ++++++++++++++++++++
 .../modules/linechecks/whitespace/whitespace.py    | 21 +++++++++++++++++
 3 files changed, 73 insertions(+)

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

diff --git a/repoman/pym/repoman/modules/linechecks/whitespace/blank.py b/repoman/pym/repoman/modules/linechecks/whitespace/blank.py
new file mode 100644
index 000000000..2ab4097a3
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/whitespace/blank.py
@@ -0,0 +1,25 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildBlankLine(LineCheck):
+	repoman_check_name = 'ebuild.minorsyn'
+	ignore_comment = False
+	blank_line = re.compile(r'^$')
+
+	def new(self, pkg):
+		self.line_is_blank = False
+
+	def check(self, num, line):
+		if self.line_is_blank and self.blank_line.match(line):
+			return 'Useless blank line on line: %d'
+		if self.blank_line.match(line):
+			self.line_is_blank = True
+		else:
+			self.line_is_blank = False
+
+	def end(self):
+		if self.line_is_blank:
+			yield 'Useless blank line on last line'

diff --git a/repoman/pym/repoman/modules/linechecks/whitespace/whitespace.py b/repoman/pym/repoman/modules/linechecks/whitespace/whitespace.py
new file mode 100644
index 000000000..556b2ab81
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/whitespace/whitespace.py
@@ -0,0 +1,21 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildWhitespace(LineCheck):
+	"""Ensure ebuilds have proper whitespacing"""
+
+	repoman_check_name = 'ebuild.minorsyn'
+
+	ignore_line = re.compile(r'(^$)|(^(\t)*#)')
+	ignore_comment = False
+	leading_spaces = re.compile(r'^[\S\t]')
+	trailing_whitespace = re.compile(r'.*([\S]$)')
+
+	def check(self, num, line):
+		if self.leading_spaces.match(line) is None:
+			return self.errors['LEADING_SPACES_ERROR']
+		if self.trailing_whitespace.match(line) is None:
+			return self.errors['TRAILING_WHITESPACE_ERROR']


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

* [gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/modules/linechecks/whitespace/
@ 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:     c52890d4cac9bb8423a27d938b3604b79e3b0f4c
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 15 01:07:13 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=c52890d4

repoman: New linechecks module, whitespace

 .../modules/linechecks/whitespace/__init__.py      | 27 ++++++++++++++++++++++
 .../repoman/modules/linechecks/whitespace/blank.py | 25 ++++++++++++++++++++
 .../modules/linechecks/whitespace/whitespace.py    | 21 +++++++++++++++++
 3 files changed, 73 insertions(+)

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

diff --git a/repoman/pym/repoman/modules/linechecks/whitespace/blank.py b/repoman/pym/repoman/modules/linechecks/whitespace/blank.py
new file mode 100644
index 000000000..2ab4097a3
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/whitespace/blank.py
@@ -0,0 +1,25 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildBlankLine(LineCheck):
+	repoman_check_name = 'ebuild.minorsyn'
+	ignore_comment = False
+	blank_line = re.compile(r'^$')
+
+	def new(self, pkg):
+		self.line_is_blank = False
+
+	def check(self, num, line):
+		if self.line_is_blank and self.blank_line.match(line):
+			return 'Useless blank line on line: %d'
+		if self.blank_line.match(line):
+			self.line_is_blank = True
+		else:
+			self.line_is_blank = False
+
+	def end(self):
+		if self.line_is_blank:
+			yield 'Useless blank line on last line'

diff --git a/repoman/pym/repoman/modules/linechecks/whitespace/whitespace.py b/repoman/pym/repoman/modules/linechecks/whitespace/whitespace.py
new file mode 100644
index 000000000..556b2ab81
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/whitespace/whitespace.py
@@ -0,0 +1,21 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildWhitespace(LineCheck):
+	"""Ensure ebuilds have proper whitespacing"""
+
+	repoman_check_name = 'ebuild.minorsyn'
+
+	ignore_line = re.compile(r'(^$)|(^(\t)*#)')
+	ignore_comment = False
+	leading_spaces = re.compile(r'^[\S\t]')
+	trailing_whitespace = re.compile(r'.*([\S]$)')
+
+	def check(self, num, line):
+		if self.leading_spaces.match(line) is None:
+			return self.errors['LEADING_SPACES_ERROR']
+		if self.trailing_whitespace.match(line) is None:
+			return self.errors['TRAILING_WHITESPACE_ERROR']


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

* [gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/modules/linechecks/whitespace/
@ 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:     717f46dff518503282f9440f1ed39fbe7698dcee
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 15 01:07:13 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=717f46df

repoman: New linechecks module, whitespace

 .../modules/linechecks/whitespace/__init__.py      | 27 ++++++++++++++++++++++
 .../repoman/modules/linechecks/whitespace/blank.py | 25 ++++++++++++++++++++
 .../modules/linechecks/whitespace/whitespace.py    | 21 +++++++++++++++++
 3 files changed, 73 insertions(+)

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

diff --git a/repoman/pym/repoman/modules/linechecks/whitespace/blank.py b/repoman/pym/repoman/modules/linechecks/whitespace/blank.py
new file mode 100644
index 000000000..2ab4097a3
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/whitespace/blank.py
@@ -0,0 +1,25 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildBlankLine(LineCheck):
+	repoman_check_name = 'ebuild.minorsyn'
+	ignore_comment = False
+	blank_line = re.compile(r'^$')
+
+	def new(self, pkg):
+		self.line_is_blank = False
+
+	def check(self, num, line):
+		if self.line_is_blank and self.blank_line.match(line):
+			return 'Useless blank line on line: %d'
+		if self.blank_line.match(line):
+			self.line_is_blank = True
+		else:
+			self.line_is_blank = False
+
+	def end(self):
+		if self.line_is_blank:
+			yield 'Useless blank line on last line'

diff --git a/repoman/pym/repoman/modules/linechecks/whitespace/whitespace.py b/repoman/pym/repoman/modules/linechecks/whitespace/whitespace.py
new file mode 100644
index 000000000..556b2ab81
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/whitespace/whitespace.py
@@ -0,0 +1,21 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildWhitespace(LineCheck):
+	"""Ensure ebuilds have proper whitespacing"""
+
+	repoman_check_name = 'ebuild.minorsyn'
+
+	ignore_line = re.compile(r'(^$)|(^(\t)*#)')
+	ignore_comment = False
+	leading_spaces = re.compile(r'^[\S\t]')
+	trailing_whitespace = re.compile(r'.*([\S]$)')
+
+	def check(self, num, line):
+		if self.leading_spaces.match(line) is None:
+			return self.errors['LEADING_SPACES_ERROR']
+		if self.trailing_whitespace.match(line) is None:
+			return self.errors['TRAILING_WHITESPACE_ERROR']


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

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

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

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