From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 9692C1389F5 for ; Mon, 17 Nov 2014 00:55:39 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 30DF6E0D5A; Mon, 17 Nov 2014 00:55:33 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 1715BE0D75 for ; Mon, 17 Nov 2014 00:55:30 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id BA821340514 for ; Mon, 17 Nov 2014 00:55:29 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 1B383A48A for ; Mon, 17 Nov 2014 00:55:26 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1416185594.b6fba118bd3e9de34ff3c4c5315fe045990e3a1e.dol-sen@gentoo> Subject: [gentoo-commits] proj/portage:repoman commit in: pym/repoman/checks/ebuilds/variables/, pym/repoman/ X-VCS-Repository: proj/portage X-VCS-Files: pym/repoman/checks/ebuilds/variables/description.py pym/repoman/main.py X-VCS-Directories: pym/repoman/checks/ebuilds/variables/ pym/repoman/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: b6fba118bd3e9de34ff3c4c5315fe045990e3a1e X-VCS-Branch: repoman Date: Mon, 17 Nov 2014 00:55:26 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 71514b8e-ead6-47cd-b6dc-fbfaa347427e X-Archives-Hash: 02ae4c5278b638d348af9a53e9df0675 commit: b6fba118bd3e9de34ff3c4c5315fe045990e3a1e Author: Tom Wijsman gentoo org> AuthorDate: Fri Jun 6 14:50:26 2014 +0000 Commit: Brian Dolbec gmail com> CommitDate: Mon Nov 17 00:53:14 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b6fba118 repoman/main.py: Split DESCRIPTION checks to checks/ebuild/variables/ --- .../checks/ebuilds/variables/description.py | 32 ++++++++++++++++++++++ pym/repoman/main.py | 13 ++++----- 2 files changed, 38 insertions(+), 7 deletions(-) diff --git a/pym/repoman/checks/ebuilds/variables/description.py b/pym/repoman/checks/ebuilds/variables/description.py new file mode 100644 index 0000000..a2b1057 --- /dev/null +++ b/pym/repoman/checks/ebuilds/variables/description.py @@ -0,0 +1,32 @@ + +'''description.py +Perform checks on the DESCRIPTION variable. +''' + +from repoman.qa_data import max_desc_len + + +class DescriptionChecks(object): + '''Perform checks on the DESCRIPTION variable.''' + + def __init__(self, qatracker): + ''' + @param qatracker: QATracker instance + ''' + self.qatracker = qatracker + + def check(self, pkg, ebuild): + ''' + @param pkg: Package in which we check (object). + @param ebuild: Ebuild which we check (object). + ''' + self._checkTooLong(pkg, ebuild) + + def _checkTooLong(self, pkg, ebuild): + # 14 is the length of DESCRIPTION="" + if len(pkg._metadata['DESCRIPTION']) > max_desc_len: + self.qatracker.add_error( + 'DESCRIPTION.toolong', + "%s: DESCRIPTION is %d characters (max %d)" % + (ebuild.relative_path, len( + pkg._metadata['DESCRIPTION']), max_desc_len)) diff --git a/pym/repoman/main.py b/pym/repoman/main.py index c6f38df..ed3cf88 100755 --- a/pym/repoman/main.py +++ b/pym/repoman/main.py @@ -58,6 +58,7 @@ from repoman.checks.ebuilds.manifests import Manifests from repoman.checks.ebuilds.misc import bad_split_check, pkg_invalid from repoman.checks.ebuilds.pkgmetadata import PkgMetadata from repoman.checks.ebuilds.use_flags import USEFlagChecks +from repoman.checks.ebuilds.variables.description import DescriptionChecks from repoman.checks.ebuilds.variables.eapi import EAPIChecks from repoman.ebuild import Ebuild from repoman.errors import err @@ -65,7 +66,7 @@ from repoman.modules.commit import repochecks from repoman.profile import check_profiles, dev_keywords, setup_profile from repoman.qa_data import ( format_qa_output, format_qa_output_column, qahelp, - qawarnings, qacats, max_desc_len, missingvars, + qawarnings, qacats, missingvars, suspect_virtual, suspect_rdepend, valid_restrict) from repoman.qa_tracker import QATracker from repoman.repos import RepoSettings, repo_metadata @@ -294,6 +295,7 @@ keywordcheck = KeywordChecks(qatracker) liveeclasscheck = LiveEclassChecks(qatracker) rubyeclasscheck = RubyEclassChecks(qatracker) eapicheck = EAPIChecks(qatracker, repo_settings) +descriptioncheck = DescriptionChecks(qatracker) ###################### for xpkg in effective_scanlist: @@ -433,12 +435,9 @@ for xpkg in effective_scanlist: myqakey = var + ".virtual" qatracker.add_error(myqakey, ebuild.relative_path) - # 14 is the length of DESCRIPTION="" - if len(myaux['DESCRIPTION']) > max_desc_len: - qatracker.add_error( - 'DESCRIPTION.toolong', - "%s: DESCRIPTION is %d characters (max %d)" % - (ebuild.relative_path, len(myaux['DESCRIPTION']), max_desc_len)) + ####################### + descriptioncheck.check(pkg, ebuild) + ####################### keywords = myaux["KEYWORDS"].split()