public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Brian Dolbec <dolsen@gentoo.org>
To: gentoo-portage-dev@lists.gentoo.org
Subject: Re: [gentoo-portage-dev] [PATCH v2 1/3] repoman: Add commit message verification
Date: Sun, 18 Feb 2018 09:11:01 -0800	[thread overview]
Message-ID: <20180218091101.7fbc2886@professor-x> (raw)
In-Reply-To: <20180217125648.1697-1-mgorny@gentoo.org>

On Sat, 17 Feb 2018 13:56:46 +0100
Michał Górny <mgorny@gentoo.org> wrote:

> +
> +	footer_re = re.compile(r'^[\w-]+:')
> +
> +	@classmethod
> +	def verify_commit_message(cls, msg):
...
> +          if all(cls.footer_re.match(l) for l in lines if l.strip()):


Why declare the footer_re in the class space?  It is only used in this
new function.  Then the function could be @staticmethod instead.  I
don't see the advantage of it this way.

If it is for re-use in other possible check functions, then perhaps it
would be best to split this out to it's own class/file that can be
added to easily.  And just run it from the Actions class as M.J.
Everitt suggested.
-- 
Brian Dolbec <dolsen>



  parent reply	other threads:[~2018-02-18 17:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-17 12:56 [gentoo-portage-dev] [PATCH v2 1/3] repoman: Add commit message verification Michał Górny
2018-02-17 12:56 ` [gentoo-portage-dev] [PATCH v2 2/3] repoman: Remove support for getting messages from stdin Michał Górny
2018-02-17 12:56 ` [gentoo-portage-dev] [PATCH v2 3/3] repoman: Verify commit messages when using EDITOR Michał Górny
2018-02-17 13:18 ` [gentoo-portage-dev] [PATCH v2 1/3] repoman: Add commit message verification M. J. Everitt
2018-02-18 16:28   ` Brian Dolbec
2018-02-18 16:35     ` M. J. Everitt
2018-02-18 17:11 ` Brian Dolbec [this message]
2018-02-18 18:47   ` Michał Górny
2018-02-19 14:27 ` Michał Górny

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=20180218091101.7fbc2886@professor-x \
    --to=dolsen@gentoo.org \
    --cc=gentoo-portage-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