From: "Brian Dolbec" <dolsen@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:repoman commit in: pym/repoman/checks/ebuilds/variables/, pym/repoman/
Date: Sat, 5 Sep 2015 21:48:08 +0000 (UTC) [thread overview]
Message-ID: <1441489658.7104d9aace97693d935f0e97f86ba4c048d3cc54.dolsen@gentoo> (raw)
commit: 7104d9aace97693d935f0e97f86ba4c048d3cc54
Author: Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 6 14:50:26 2014 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat Sep 5 21:47:38 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=7104d9aa
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 6bfd1be..f692b63 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -61,6 +61,7 @@ from repoman.check_missingslot import check_missingslot
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
@@ -68,7 +69,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
@@ -297,6 +298,7 @@ keywordcheck = KeywordChecks(qatracker, options)
liveeclasscheck = LiveEclassChecks(qatracker)
rubyeclasscheck = RubyEclassChecks(qatracker)
eapicheck = EAPIChecks(qatracker, repo_settings)
+descriptioncheck = DescriptionChecks(qatracker)
######################
for xpkg in effective_scanlist:
@@ -436,12 +438,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()
next reply other threads:[~2015-09-05 21:48 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-05 21:48 Brian Dolbec [this message]
-- strict thread matches above, loose matches on Subject: below --
2015-09-21 23:47 [gentoo-commits] proj/portage:repoman commit in: pym/repoman/checks/ebuilds/variables/, pym/repoman/ Brian Dolbec
2015-09-21 23:47 Brian Dolbec
2015-09-17 4:51 Brian Dolbec
2015-09-17 4:51 Brian Dolbec
2015-09-17 3:08 Brian Dolbec
2015-09-17 3:08 Brian Dolbec
2015-09-17 3:08 Brian Dolbec
2015-09-05 21:48 Brian Dolbec
2015-09-05 21:48 Brian Dolbec
2015-09-05 21:27 Brian Dolbec
2015-08-11 23:54 Brian Dolbec
2015-08-11 23:54 Brian Dolbec
2015-08-10 14:45 Michał Górny
2015-08-10 14:45 Michał Górny
2015-08-10 13:44 Brian Dolbec
2014-11-17 0:55 Brian Dolbec
2014-11-17 0:55 Brian Dolbec
2014-11-17 0:55 Brian Dolbec
2014-10-01 23:46 Brian Dolbec
2014-10-01 23:46 Brian Dolbec
2014-10-01 23:46 Brian Dolbec
2014-10-01 23:02 Brian Dolbec
2014-10-01 23:02 Brian Dolbec
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1441489658.7104d9aace97693d935f0e97f86ba4c048d3cc54.dolsen@gentoo \
--to=dolsen@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox