public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/modules/scan/eclasses/, ...
@ 2016-01-11  8:01 Brian Dolbec
  0 siblings, 0 replies; 5+ messages in thread
From: Brian Dolbec @ 2016-01-11  8:01 UTC (permalink / raw
  To: gentoo-commits

commit:     470d7eeea7e63ecf4253a829eaaad6d98afee986
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Fri Jan  8 08:46:01 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Jan 11 08:00:17 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=470d7eee

repoman: Create RubyEclassChecks class plugin

 pym/repoman/checks/ebuilds/eclasses/__init__.py        |  0
 pym/repoman/modules/scan/eclasses/__init__.py          |  8 ++++++++
 .../{checks/ebuilds => modules/scan}/eclasses/ruby.py  | 18 ++++++++++++++----
 pym/repoman/scanner.py                                 |  9 ++-------
 4 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/eclasses/__init__.py b/pym/repoman/checks/ebuilds/eclasses/__init__.py
deleted file mode 100644
index e69de29..0000000

diff --git a/pym/repoman/modules/scan/eclasses/__init__.py b/pym/repoman/modules/scan/eclasses/__init__.py
index a821f5c..70a6252 100644
--- a/pym/repoman/modules/scan/eclasses/__init__.py
+++ b/pym/repoman/modules/scan/eclasses/__init__.py
@@ -18,6 +18,14 @@ module_spec = {
 			'func_kwargs': {
 			},
 		},
+		'ruby-module': {
+			'name': "ruby",
+			'class': "RubyEclassChecks",
+			'description': doc,
+			'functions': ['check'],
+			'func_kwargs': {
+			},
+		},
 	}
 }
 

diff --git a/pym/repoman/checks/ebuilds/eclasses/ruby.py b/pym/repoman/modules/scan/eclasses/ruby.py
similarity index 62%
rename from pym/repoman/checks/ebuilds/eclasses/ruby.py
rename to pym/repoman/modules/scan/eclasses/ruby.py
index e8d36ea..4dc5d62 100644
--- a/pym/repoman/checks/ebuilds/eclasses/ruby.py
+++ b/pym/repoman/modules/scan/eclasses/ruby.py
@@ -4,19 +4,23 @@ Performs Ruby eclass checks
 '''
 
 from repoman.qa_data import ruby_deprecated
+from repoman.modules.scan.scanbase import ScanBase
 
 
-class RubyEclassChecks(object):
+class RubyEclassChecks(ScanBase):
 	'''Performs checks for the usage of Ruby eclasses in ebuilds'''
 
-	def __init__(self, qatracker):
+	def __init__(self, **kwargs):
 		'''
 		@param qatracker: QATracker instance
 		'''
-		self.qatracker = qatracker
+		super(RubyEclassChecks, self).__init__(**kwargs)
+		self.qatracker = kwargs.get('qatracker')
 		self.old_ruby_eclasses = ["ruby-ng", "ruby-fakegem", "ruby"]
 
-	def check(self, pkg, ebuild):
+	def check(self, **kwargs):
+		pkg = kwargs.get('pkg')
+		ebuild = kwargs.get('ebuild')
 		is_inherited = lambda eclass: eclass in pkg.inherited
 		is_old_ruby_eclass_inherited = filter(
 			is_inherited, self.old_ruby_eclasses)
@@ -30,3 +34,9 @@ class RubyEclassChecks(object):
 						"IUSE.rubydeprecated",
 						(ebuild.relative_path + ": Deprecated ruby target: %s")
 						% myruby)
+		return {'continue': False}
+
+	@property
+	def runInEbuilds(self):
+		'''Ebuild level scans'''
+		return (True, [self.check])

diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
index 0227a93..e6a17cd 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -18,7 +18,6 @@ from portage import _unicode_encode
 from portage.dep import Atom
 from portage.output import green
 from repoman.checks.ebuilds.checks import run_checks
-from repoman.checks.ebuilds.eclasses.ruby import RubyEclassChecks
 from repoman.checks.ebuilds.variables.license import LicenseChecks
 from repoman.checks.ebuilds.variables.restrict import RestrictChecks
 from repoman.modules.commit import repochecks
@@ -211,7 +210,6 @@ class Scanner(object):
 			self.modules[mod_class.__name__] = mod_class(**self.kwargs)
 
 		# initialize our checks classes here before the big xpkg loop
-		self.rubyeclasscheck = RubyEclassChecks(self.qatracker)
 		self.licensecheck = LicenseChecks(self.qatracker, liclist, liclist_deprecated)
 		self.restrictcheck = RestrictChecks(self.qatracker)
 
@@ -298,7 +296,7 @@ class Scanner(object):
 				('thirdpartymirrors', 'ThirdPartyMirrors'),
 				('description', 'DescriptionChecks'), (None, 'KeywordChecks'),
 				('arches', 'ArchChecks'), ('depend', 'DependChecks'),
-				('use_flags', 'USEFlagChecks'),
+				('use_flags', 'USEFlagChecks'), ('ruby', 'RubyEclassChecks'),
 				]:
 				if mod[0]:
 					mod_class = MODULE_CONTROLLER.get_class(mod[0])
@@ -361,9 +359,7 @@ class Scanner(object):
 			badlicsyntax = badlicsyntax > 0
 			badprovsyntax = badprovsyntax > 0
 
-			used_useflags = used_useflags.union(dynamic_data['ebuild_used_useflags'])
-
-			self.rubyeclasscheck.check(dynamic_data['pkg'], dynamic_data['ebuild'])
+			used_useflags = used_useflags.union(dynamic_data['ebuild_UsedUseFlags'])
 
 			# license checks
 			if not badlicsyntax:
@@ -573,7 +569,6 @@ class Scanner(object):
 
 		# check if there are unused local USE-descriptions in metadata.xml
 		# (unless there are any invalids, to avoid noise)
-			for myflag in dynamic_data['muselist'].difference(used_useflags):
 		if dynamic_data['allvalid']:
 			for myflag in dynamic_data['muselist'].difference(used_useflags):
 				self.qatracker.add_error(


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

* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/modules/scan/eclasses/, ...
@ 2016-01-21 18:30 Brian Dolbec
  0 siblings, 0 replies; 5+ messages in thread
From: Brian Dolbec @ 2016-01-21 18:30 UTC (permalink / raw
  To: gentoo-commits

commit:     7a16c107438b06888dfee938ba0bcdd01dadef1a
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Fri Jan  8 08:46:01 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Thu Jan 21 00:35:22 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=7a16c107

repoman: Create RubyEclassChecks class plugin

 pym/repoman/checks/ebuilds/eclasses/__init__.py        |  0
 pym/repoman/modules/scan/eclasses/__init__.py          |  8 ++++++++
 .../{checks/ebuilds => modules/scan}/eclasses/ruby.py  | 18 ++++++++++++++----
 pym/repoman/scanner.py                                 |  9 ++-------
 4 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/eclasses/__init__.py b/pym/repoman/checks/ebuilds/eclasses/__init__.py
deleted file mode 100644
index e69de29..0000000

diff --git a/pym/repoman/modules/scan/eclasses/__init__.py b/pym/repoman/modules/scan/eclasses/__init__.py
index a821f5c..70a6252 100644
--- a/pym/repoman/modules/scan/eclasses/__init__.py
+++ b/pym/repoman/modules/scan/eclasses/__init__.py
@@ -18,6 +18,14 @@ module_spec = {
 			'func_kwargs': {
 			},
 		},
+		'ruby-module': {
+			'name': "ruby",
+			'class': "RubyEclassChecks",
+			'description': doc,
+			'functions': ['check'],
+			'func_kwargs': {
+			},
+		},
 	}
 }
 

diff --git a/pym/repoman/checks/ebuilds/eclasses/ruby.py b/pym/repoman/modules/scan/eclasses/ruby.py
similarity index 62%
rename from pym/repoman/checks/ebuilds/eclasses/ruby.py
rename to pym/repoman/modules/scan/eclasses/ruby.py
index e8d36ea..4dc5d62 100644
--- a/pym/repoman/checks/ebuilds/eclasses/ruby.py
+++ b/pym/repoman/modules/scan/eclasses/ruby.py
@@ -4,19 +4,23 @@ Performs Ruby eclass checks
 '''
 
 from repoman.qa_data import ruby_deprecated
+from repoman.modules.scan.scanbase import ScanBase
 
 
-class RubyEclassChecks(object):
+class RubyEclassChecks(ScanBase):
 	'''Performs checks for the usage of Ruby eclasses in ebuilds'''
 
-	def __init__(self, qatracker):
+	def __init__(self, **kwargs):
 		'''
 		@param qatracker: QATracker instance
 		'''
-		self.qatracker = qatracker
+		super(RubyEclassChecks, self).__init__(**kwargs)
+		self.qatracker = kwargs.get('qatracker')
 		self.old_ruby_eclasses = ["ruby-ng", "ruby-fakegem", "ruby"]
 
-	def check(self, pkg, ebuild):
+	def check(self, **kwargs):
+		pkg = kwargs.get('pkg')
+		ebuild = kwargs.get('ebuild')
 		is_inherited = lambda eclass: eclass in pkg.inherited
 		is_old_ruby_eclass_inherited = filter(
 			is_inherited, self.old_ruby_eclasses)
@@ -30,3 +34,9 @@ class RubyEclassChecks(object):
 						"IUSE.rubydeprecated",
 						(ebuild.relative_path + ": Deprecated ruby target: %s")
 						% myruby)
+		return {'continue': False}
+
+	@property
+	def runInEbuilds(self):
+		'''Ebuild level scans'''
+		return (True, [self.check])

diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
index 0227a93..e6a17cd 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -18,7 +18,6 @@ from portage import _unicode_encode
 from portage.dep import Atom
 from portage.output import green
 from repoman.checks.ebuilds.checks import run_checks
-from repoman.checks.ebuilds.eclasses.ruby import RubyEclassChecks
 from repoman.checks.ebuilds.variables.license import LicenseChecks
 from repoman.checks.ebuilds.variables.restrict import RestrictChecks
 from repoman.modules.commit import repochecks
@@ -211,7 +210,6 @@ class Scanner(object):
 			self.modules[mod_class.__name__] = mod_class(**self.kwargs)
 
 		# initialize our checks classes here before the big xpkg loop
-		self.rubyeclasscheck = RubyEclassChecks(self.qatracker)
 		self.licensecheck = LicenseChecks(self.qatracker, liclist, liclist_deprecated)
 		self.restrictcheck = RestrictChecks(self.qatracker)
 
@@ -298,7 +296,7 @@ class Scanner(object):
 				('thirdpartymirrors', 'ThirdPartyMirrors'),
 				('description', 'DescriptionChecks'), (None, 'KeywordChecks'),
 				('arches', 'ArchChecks'), ('depend', 'DependChecks'),
-				('use_flags', 'USEFlagChecks'),
+				('use_flags', 'USEFlagChecks'), ('ruby', 'RubyEclassChecks'),
 				]:
 				if mod[0]:
 					mod_class = MODULE_CONTROLLER.get_class(mod[0])
@@ -361,9 +359,7 @@ class Scanner(object):
 			badlicsyntax = badlicsyntax > 0
 			badprovsyntax = badprovsyntax > 0
 
-			used_useflags = used_useflags.union(dynamic_data['ebuild_used_useflags'])
-
-			self.rubyeclasscheck.check(dynamic_data['pkg'], dynamic_data['ebuild'])
+			used_useflags = used_useflags.union(dynamic_data['ebuild_UsedUseFlags'])
 
 			# license checks
 			if not badlicsyntax:
@@ -573,7 +569,6 @@ class Scanner(object):
 
 		# check if there are unused local USE-descriptions in metadata.xml
 		# (unless there are any invalids, to avoid noise)
-			for myflag in dynamic_data['muselist'].difference(used_useflags):
 		if dynamic_data['allvalid']:
 			for myflag in dynamic_data['muselist'].difference(used_useflags):
 				self.qatracker.add_error(


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

* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/modules/scan/eclasses/, ...
@ 2016-01-27 23:15 Brian Dolbec
  0 siblings, 0 replies; 5+ messages in thread
From: Brian Dolbec @ 2016-01-27 23:15 UTC (permalink / raw
  To: gentoo-commits

commit:     651d49efec761a6058cd484e6cfb6827c793681d
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Fri Jan  8 08:46:01 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Wed Jan 27 22:44:22 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=651d49ef

repoman: Create RubyEclassChecks class plugin

 pym/repoman/checks/ebuilds/eclasses/__init__.py        |  0
 pym/repoman/modules/scan/eclasses/__init__.py          |  9 +++++++++
 .../{checks/ebuilds => modules/scan}/eclasses/ruby.py  | 18 ++++++++++++++----
 pym/repoman/scanner.py                                 |  9 ++-------
 4 files changed, 25 insertions(+), 11 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/eclasses/__init__.py b/pym/repoman/checks/ebuilds/eclasses/__init__.py
deleted file mode 100644
index e69de29..0000000

diff --git a/pym/repoman/modules/scan/eclasses/__init__.py b/pym/repoman/modules/scan/eclasses/__init__.py
index ed9a7c7..126f2a6 100644
--- a/pym/repoman/modules/scan/eclasses/__init__.py
+++ b/pym/repoman/modules/scan/eclasses/__init__.py
@@ -19,6 +19,15 @@ module_spec = {
 			'func_kwargs': {
 			},
 		},
+		'ruby-module': {
+			'name': "ruby",
+			'sourcefile': "ruby",
+			'class': "RubyEclassChecks",
+			'description': doc,
+			'functions': ['check'],
+			'func_kwargs': {
+			},
+		},
 	}
 }
 

diff --git a/pym/repoman/checks/ebuilds/eclasses/ruby.py b/pym/repoman/modules/scan/eclasses/ruby.py
similarity index 62%
rename from pym/repoman/checks/ebuilds/eclasses/ruby.py
rename to pym/repoman/modules/scan/eclasses/ruby.py
index e8d36ea..4dc5d62 100644
--- a/pym/repoman/checks/ebuilds/eclasses/ruby.py
+++ b/pym/repoman/modules/scan/eclasses/ruby.py
@@ -4,19 +4,23 @@ Performs Ruby eclass checks
 '''
 
 from repoman.qa_data import ruby_deprecated
+from repoman.modules.scan.scanbase import ScanBase
 
 
-class RubyEclassChecks(object):
+class RubyEclassChecks(ScanBase):
 	'''Performs checks for the usage of Ruby eclasses in ebuilds'''
 
-	def __init__(self, qatracker):
+	def __init__(self, **kwargs):
 		'''
 		@param qatracker: QATracker instance
 		'''
-		self.qatracker = qatracker
+		super(RubyEclassChecks, self).__init__(**kwargs)
+		self.qatracker = kwargs.get('qatracker')
 		self.old_ruby_eclasses = ["ruby-ng", "ruby-fakegem", "ruby"]
 
-	def check(self, pkg, ebuild):
+	def check(self, **kwargs):
+		pkg = kwargs.get('pkg')
+		ebuild = kwargs.get('ebuild')
 		is_inherited = lambda eclass: eclass in pkg.inherited
 		is_old_ruby_eclass_inherited = filter(
 			is_inherited, self.old_ruby_eclasses)
@@ -30,3 +34,9 @@ class RubyEclassChecks(object):
 						"IUSE.rubydeprecated",
 						(ebuild.relative_path + ": Deprecated ruby target: %s")
 						% myruby)
+		return {'continue': False}
+
+	@property
+	def runInEbuilds(self):
+		'''Ebuild level scans'''
+		return (True, [self.check])

diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
index 2101f13..febbc1d 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -18,7 +18,6 @@ from portage import _unicode_encode
 from portage.dep import Atom
 from portage.output import green
 from repoman.checks.ebuilds.checks import run_checks
-from repoman.checks.ebuilds.eclasses.ruby import RubyEclassChecks
 from repoman.checks.ebuilds.variables.license import LicenseChecks
 from repoman.checks.ebuilds.variables.restrict import RestrictChecks
 from repoman.modules.commit import repochecks
@@ -214,7 +213,6 @@ class Scanner(object):
 			self.modules[mod_class.__name__] = mod_class(**self.kwargs)
 
 		# initialize our checks classes here before the big xpkg loop
-		self.rubyeclasscheck = RubyEclassChecks(self.qatracker)
 		self.licensecheck = LicenseChecks(self.qatracker, liclist, liclist_deprecated)
 		self.restrictcheck = RestrictChecks(self.qatracker)
 
@@ -301,7 +299,7 @@ class Scanner(object):
 				('thirdpartymirrors', 'ThirdPartyMirrors'),
 				('description', 'DescriptionChecks'), (None, 'KeywordChecks'),
 				('arches', 'ArchChecks'), ('depend', 'DependChecks'),
-				('use_flags', 'USEFlagChecks'),
+				('use_flags', 'USEFlagChecks'), ('ruby', 'RubyEclassChecks'),
 				]:
 				if mod[0]:
 					mod_class = MODULE_CONTROLLER.get_class(mod[0])
@@ -364,9 +362,7 @@ class Scanner(object):
 			badlicsyntax = badlicsyntax > 0
 			badprovsyntax = badprovsyntax > 0
 
-			used_useflags = used_useflags.union(dynamic_data['ebuild_used_useflags'])
-
-			self.rubyeclasscheck.check(dynamic_data['pkg'], dynamic_data['ebuild'])
+			used_useflags = used_useflags.union(dynamic_data['ebuild_UsedUseFlags'])
 
 			# license checks
 			if not badlicsyntax:
@@ -576,7 +572,6 @@ class Scanner(object):
 
 		# check if there are unused local USE-descriptions in metadata.xml
 		# (unless there are any invalids, to avoid noise)
-			for myflag in dynamic_data['muselist'].difference(used_useflags):
 		if dynamic_data['allvalid']:
 			for myflag in dynamic_data['muselist'].difference(used_useflags):
 				self.qatracker.add_error(


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

* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/modules/scan/eclasses/, ...
@ 2016-01-30  6:58 Brian Dolbec
  0 siblings, 0 replies; 5+ messages in thread
From: Brian Dolbec @ 2016-01-30  6:58 UTC (permalink / raw
  To: gentoo-commits

commit:     e4f60d8e53d82e90671576e01ae9b7f8ea519c66
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Fri Jan  8 08:46:01 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat Jan 30 06:33:55 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=e4f60d8e

repoman: Create RubyEclassChecks class plugin

 pym/repoman/checks/ebuilds/eclasses/__init__.py        |  0
 pym/repoman/modules/scan/eclasses/__init__.py          |  9 +++++++++
 .../{checks/ebuilds => modules/scan}/eclasses/ruby.py  | 18 ++++++++++++++----
 pym/repoman/scanner.py                                 |  9 ++-------
 4 files changed, 25 insertions(+), 11 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/eclasses/__init__.py b/pym/repoman/checks/ebuilds/eclasses/__init__.py
deleted file mode 100644
index e69de29..0000000

diff --git a/pym/repoman/modules/scan/eclasses/__init__.py b/pym/repoman/modules/scan/eclasses/__init__.py
index ed9a7c7..126f2a6 100644
--- a/pym/repoman/modules/scan/eclasses/__init__.py
+++ b/pym/repoman/modules/scan/eclasses/__init__.py
@@ -19,6 +19,15 @@ module_spec = {
 			'func_kwargs': {
 			},
 		},
+		'ruby-module': {
+			'name': "ruby",
+			'sourcefile': "ruby",
+			'class': "RubyEclassChecks",
+			'description': doc,
+			'functions': ['check'],
+			'func_kwargs': {
+			},
+		},
 	}
 }
 

diff --git a/pym/repoman/checks/ebuilds/eclasses/ruby.py b/pym/repoman/modules/scan/eclasses/ruby.py
similarity index 62%
rename from pym/repoman/checks/ebuilds/eclasses/ruby.py
rename to pym/repoman/modules/scan/eclasses/ruby.py
index e8d36ea..4dc5d62 100644
--- a/pym/repoman/checks/ebuilds/eclasses/ruby.py
+++ b/pym/repoman/modules/scan/eclasses/ruby.py
@@ -4,19 +4,23 @@ Performs Ruby eclass checks
 '''
 
 from repoman.qa_data import ruby_deprecated
+from repoman.modules.scan.scanbase import ScanBase
 
 
-class RubyEclassChecks(object):
+class RubyEclassChecks(ScanBase):
 	'''Performs checks for the usage of Ruby eclasses in ebuilds'''
 
-	def __init__(self, qatracker):
+	def __init__(self, **kwargs):
 		'''
 		@param qatracker: QATracker instance
 		'''
-		self.qatracker = qatracker
+		super(RubyEclassChecks, self).__init__(**kwargs)
+		self.qatracker = kwargs.get('qatracker')
 		self.old_ruby_eclasses = ["ruby-ng", "ruby-fakegem", "ruby"]
 
-	def check(self, pkg, ebuild):
+	def check(self, **kwargs):
+		pkg = kwargs.get('pkg')
+		ebuild = kwargs.get('ebuild')
 		is_inherited = lambda eclass: eclass in pkg.inherited
 		is_old_ruby_eclass_inherited = filter(
 			is_inherited, self.old_ruby_eclasses)
@@ -30,3 +34,9 @@ class RubyEclassChecks(object):
 						"IUSE.rubydeprecated",
 						(ebuild.relative_path + ": Deprecated ruby target: %s")
 						% myruby)
+		return {'continue': False}
+
+	@property
+	def runInEbuilds(self):
+		'''Ebuild level scans'''
+		return (True, [self.check])

diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
index 23642c3..006c3f7 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -18,7 +18,6 @@ from portage import _unicode_encode
 from portage.dep import Atom
 from portage.output import green
 from repoman.checks.ebuilds.checks import run_checks
-from repoman.checks.ebuilds.eclasses.ruby import RubyEclassChecks
 from repoman.checks.ebuilds.variables.license import LicenseChecks
 from repoman.checks.ebuilds.variables.restrict import RestrictChecks
 from repoman.modules.commit import repochecks
@@ -214,7 +213,6 @@ class Scanner(object):
 			self.modules[mod_class.__name__] = mod_class(**self.kwargs)
 
 		# initialize our checks classes here before the big xpkg loop
-		self.rubyeclasscheck = RubyEclassChecks(self.qatracker)
 		self.licensecheck = LicenseChecks(self.qatracker, liclist, liclist_deprecated)
 		self.restrictcheck = RestrictChecks(self.qatracker)
 
@@ -301,7 +299,7 @@ class Scanner(object):
 				('thirdpartymirrors', 'ThirdPartyMirrors'),
 				('description', 'DescriptionChecks'), (None, 'KeywordChecks'),
 				('arches', 'ArchChecks'), ('depend', 'DependChecks'),
-				('use_flags', 'USEFlagChecks'),
+				('use_flags', 'USEFlagChecks'), ('ruby', 'RubyEclassChecks'),
 				]:
 				if mod[0]:
 					mod_class = MODULE_CONTROLLER.get_class(mod[0])
@@ -364,9 +362,7 @@ class Scanner(object):
 			badlicsyntax = badlicsyntax > 0
 			badprovsyntax = badprovsyntax > 0
 
-			used_useflags = used_useflags.union(dynamic_data['ebuild_used_useflags'])
-
-			self.rubyeclasscheck.check(dynamic_data['pkg'], dynamic_data['ebuild'])
+			used_useflags = used_useflags.union(dynamic_data['ebuild_UsedUseFlags'])
 
 			# license checks
 			if not badlicsyntax:
@@ -576,7 +572,6 @@ class Scanner(object):
 
 		# check if there are unused local USE-descriptions in metadata.xml
 		# (unless there are any invalids, to avoid noise)
-			for myflag in dynamic_data['muselist'].difference(used_useflags):
 		if dynamic_data['allvalid']:
 			for myflag in dynamic_data['muselist'].difference(used_useflags):
 				self.qatracker.add_error(


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

* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/modules/scan/eclasses/, ...
@ 2016-01-31 20:03 Brian Dolbec
  0 siblings, 0 replies; 5+ messages in thread
From: Brian Dolbec @ 2016-01-31 20:03 UTC (permalink / raw
  To: gentoo-commits

commit:     d2dd97b04e5b44eb1265576929d8957cc2b3eeb2
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Fri Jan  8 08:46:01 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat Jan 30 20:25:21 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=d2dd97b0

repoman: Create RubyEclassChecks class plugin

 pym/repoman/checks/ebuilds/eclasses/__init__.py        |  0
 pym/repoman/modules/scan/eclasses/__init__.py          |  9 +++++++++
 .../{checks/ebuilds => modules/scan}/eclasses/ruby.py  | 18 ++++++++++++++----
 pym/repoman/scanner.py                                 |  8 ++------
 4 files changed, 25 insertions(+), 10 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/eclasses/__init__.py b/pym/repoman/checks/ebuilds/eclasses/__init__.py
deleted file mode 100644
index e69de29..0000000

diff --git a/pym/repoman/modules/scan/eclasses/__init__.py b/pym/repoman/modules/scan/eclasses/__init__.py
index ed9a7c7..126f2a6 100644
--- a/pym/repoman/modules/scan/eclasses/__init__.py
+++ b/pym/repoman/modules/scan/eclasses/__init__.py
@@ -19,6 +19,15 @@ module_spec = {
 			'func_kwargs': {
 			},
 		},
+		'ruby-module': {
+			'name': "ruby",
+			'sourcefile': "ruby",
+			'class': "RubyEclassChecks",
+			'description': doc,
+			'functions': ['check'],
+			'func_kwargs': {
+			},
+		},
 	}
 }
 

diff --git a/pym/repoman/checks/ebuilds/eclasses/ruby.py b/pym/repoman/modules/scan/eclasses/ruby.py
similarity index 62%
rename from pym/repoman/checks/ebuilds/eclasses/ruby.py
rename to pym/repoman/modules/scan/eclasses/ruby.py
index e8d36ea..4dc5d62 100644
--- a/pym/repoman/checks/ebuilds/eclasses/ruby.py
+++ b/pym/repoman/modules/scan/eclasses/ruby.py
@@ -4,19 +4,23 @@ Performs Ruby eclass checks
 '''
 
 from repoman.qa_data import ruby_deprecated
+from repoman.modules.scan.scanbase import ScanBase
 
 
-class RubyEclassChecks(object):
+class RubyEclassChecks(ScanBase):
 	'''Performs checks for the usage of Ruby eclasses in ebuilds'''
 
-	def __init__(self, qatracker):
+	def __init__(self, **kwargs):
 		'''
 		@param qatracker: QATracker instance
 		'''
-		self.qatracker = qatracker
+		super(RubyEclassChecks, self).__init__(**kwargs)
+		self.qatracker = kwargs.get('qatracker')
 		self.old_ruby_eclasses = ["ruby-ng", "ruby-fakegem", "ruby"]
 
-	def check(self, pkg, ebuild):
+	def check(self, **kwargs):
+		pkg = kwargs.get('pkg')
+		ebuild = kwargs.get('ebuild')
 		is_inherited = lambda eclass: eclass in pkg.inherited
 		is_old_ruby_eclass_inherited = filter(
 			is_inherited, self.old_ruby_eclasses)
@@ -30,3 +34,9 @@ class RubyEclassChecks(object):
 						"IUSE.rubydeprecated",
 						(ebuild.relative_path + ": Deprecated ruby target: %s")
 						% myruby)
+		return {'continue': False}
+
+	@property
+	def runInEbuilds(self):
+		'''Ebuild level scans'''
+		return (True, [self.check])

diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
index 0248a66..c5601dd 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -18,7 +18,6 @@ from portage import _unicode_encode
 from portage.dep import Atom
 from portage.output import green
 from repoman.checks.ebuilds.checks import run_checks
-from repoman.checks.ebuilds.eclasses.ruby import RubyEclassChecks
 from repoman.checks.ebuilds.variables.license import LicenseChecks
 from repoman.checks.ebuilds.variables.restrict import RestrictChecks
 from repoman.modules.commit import repochecks
@@ -214,7 +213,6 @@ class Scanner(object):
 			self.modules[mod_class.__name__] = mod_class(**self.kwargs)
 
 		# initialize our checks classes here before the big xpkg loop
-		self.rubyeclasscheck = RubyEclassChecks(self.qatracker)
 		self.licensecheck = LicenseChecks(self.qatracker, liclist, liclist_deprecated)
 		self.restrictcheck = RestrictChecks(self.qatracker)
 
@@ -301,7 +299,7 @@ class Scanner(object):
 				('thirdpartymirrors', 'ThirdPartyMirrors'),
 				('description', 'DescriptionChecks'), (None, 'KeywordChecks'),
 				('arches', 'ArchChecks'), ('depend', 'DependChecks'),
-				('use_flags', 'USEFlagChecks'),
+				('use_flags', 'USEFlagChecks'), ('ruby', 'RubyEclassChecks'),
 				]:
 				if mod[0]:
 					mod_class = MODULE_CONTROLLER.get_class(mod[0])
@@ -364,9 +362,7 @@ class Scanner(object):
 			badlicsyntax = badlicsyntax > 0
 			badprovsyntax = badprovsyntax > 0
 
-			used_useflags = used_useflags.union(dynamic_data['ebuild_used_useflags'])
-
-			self.rubyeclasscheck.check(dynamic_data['pkg'], dynamic_data['ebuild'])
+			used_useflags = used_useflags.union(dynamic_data['ebuild_UsedUseFlags'])
 
 			# license checks
 			if not badlicsyntax:


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

end of thread, other threads:[~2016-01-31 20:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-31 20:03 [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/modules/scan/eclasses/, Brian Dolbec
  -- strict thread matches above, loose matches on Subject: below --
2016-01-30  6:58 Brian Dolbec
2016-01-27 23:15 Brian Dolbec
2016-01-21 18:30 Brian Dolbec
2016-01-11  8:01 Brian Dolbec

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