commit: 0e6a9c7e274d9eba6ca98aedb239bf9e7cc8e7f5 Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> AuthorDate: Sat Jul 15 01:09:03 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=0e6a9c7e
repoman: Convert multicheck module to the new linechecks sub-module repoman/pym/repoman/modules/scan/ebuild/__init__.py | 2 +- repoman/pym/repoman/modules/scan/ebuild/multicheck.py | 10 +++++++--- repoman/pym/repoman/scanner.py | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/repoman/pym/repoman/modules/scan/ebuild/__init__.py b/repoman/pym/repoman/modules/scan/ebuild/__init__.py index 3e1d31951..1d8ec1941 100644 --- a/repoman/pym/repoman/modules/scan/ebuild/__init__.py +++ b/repoman/pym/repoman/modules/scan/ebuild/__init__.py @@ -47,7 +47,7 @@ module_spec = { 'functions': ['check'], 'func_kwargs': { }, - 'mod_kwargs': ['qatracker', 'options' + 'mod_kwargs': ['qatracker', 'options', 'repo_settings', 'linechecks', ], 'func_kwargs': { 'ebuild': (None, None), diff --git a/repoman/pym/repoman/modules/scan/ebuild/multicheck.py b/repoman/pym/repoman/modules/scan/ebuild/multicheck.py index 9e36e2a68..94526ae9e 100644 --- a/repoman/pym/repoman/modules/scan/ebuild/multicheck.py +++ b/repoman/pym/repoman/modules/scan/ebuild/multicheck.py @@ -8,7 +8,7 @@ import io from portage import _encodings, _unicode_encode from repoman.modules.scan.scanbase import ScanBase -from .checks import run_checks, checks_init +from repoman.modules.linechecks.controller import LineCheckController class MultiCheck(ScanBase): @@ -22,7 +22,11 @@ class MultiCheck(ScanBase): ''' self.qatracker = kwargs.get('qatracker') self.options = kwargs.get('options') - checks_init(self.options.experimental_inherit == 'y') + self.controller = LineCheckController( + kwargs.get('repo_settings'), + kwargs.get('linechecks') + ) + self.controller.checks_init(self.options.experimental_inherit == 'y') def check(self, **kwargs): '''Check the ebuild for utf-8 encoding @@ -40,7 +44,7 @@ class MultiCheck(ScanBase): errors='strict'), mode='r', encoding=_encodings['repo.content']) try: - for check_name, e in run_checks(f, pkg): + for check_name, e in self.controller.run_checks(f, pkg): self.qatracker.add_error( check_name, ebuild.relative_path + ': %s' % e) finally: diff --git a/repoman/pym/repoman/scanner.py b/repoman/pym/repoman/scanner.py index b3d030570..d61e50131 100644 --- a/repoman/pym/repoman/scanner.py +++ b/repoman/pym/repoman/scanner.py @@ -193,6 +193,7 @@ class Scanner(object): "env": self.env, "have": self.have, "dev_keywords": self.dev_keywords, + "linechecks": self.moduleconfig.linechecks, } # initialize the plugin checks here self.modules = {}