From patchwork Thu Jun 7 08:45:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 926206 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="FubpvtcB"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 411fJC6xMJz9s01 for ; Thu, 7 Jun 2018 18:45:31 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 8D013C22019; Thu, 7 Jun 2018 08:45:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id D0681C21E13; Thu, 7 Jun 2018 08:45:19 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 450FDC21E13; Thu, 7 Jun 2018 08:45:18 +0000 (UTC) Received: from mail-pf0-f169.google.com (mail-pf0-f169.google.com [209.85.192.169]) by lists.denx.de (Postfix) with ESMTPS id 98B27C21C4A for ; Thu, 7 Jun 2018 08:45:17 +0000 (UTC) Received: by mail-pf0-f169.google.com with SMTP id c22-v6so4160032pfi.2 for ; Thu, 07 Jun 2018 01:45:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=sOwLP98ZL5tnZfhS2eFC5KvEKWlOC3h9KRXVXyDFxSc=; b=FubpvtcB9O2HZ0mIYpbRBQv402ABaJf9rIJMylrRkNiBIGh1S2Ox8SYpuCdC0hAHN7 V5PcMhmBt2J2dZqPjH/MlMU4K+NWE3OvzTvkgY8ZvLE1o5f7z77zVk28dI0PSqrA7RGC JI0e7i/25UGBumUsuTidZcnVlhlsZlxD38bqukytVAMgbtm0HuiDwlYtANBrlMclY6+i BdOcTX5PgTSowLFDlBJWNiZZqSqEq53gBjDgC58/6rWq2rST6j0TMSo9WAKgZC43QIHr 9hMFeZVMBudp49ru9aD7vJl4l1AqPpdXD5Ih+sIdqRRQ7d/8c6kfU0kxkyElUKaGJxvL UOXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=sOwLP98ZL5tnZfhS2eFC5KvEKWlOC3h9KRXVXyDFxSc=; b=uQaC4vTs5kvwyq1K1WDJrF4L7nbOLsA1SGYqOUzmxeEFaeEQhsOZX/ckAVkJMeuiOR Ocz1dG755dcKD0EtNq8dyDb3E2or7CecMDfYhX4LmfptGaQDppX9ZF0EPq5BAFty+KHI CEn8VW0sq6nNcfqSgDx+aW2CBRbSghjXSQnlZSPqwIYJI6GHAlA1g6kZkiaadC57T3AT i8QIepy95BR+vjPs46jrLWb7pauWmn5udTCZ/y8Uo0C9RiMsFdeK3YRE414DEhb30jvK l8Cwmcq/TlRgYSybkJ5srdxMbqPkVw10sj4aDKg0SitAd+OK3At8Gr+7DiQbD4+379rI zAeg== X-Gm-Message-State: APt69E2ZKLpsLH1m/91dZZ/bjOtSjTBY7rpWim9mswhOa6IVo/gNyPHK ePjZA8vLPcwYzmO4Vk7bjdS2pzfj X-Google-Smtp-Source: ADUXVKIFkcj0NTkKU2ab5Qqi2K+jlC5vHAOGCaJ+QQe15o6RBFtlXSl2D7pYyHjeoCy9Cp7NdLUOXg== X-Received: by 2002:a65:5686:: with SMTP id v6-v6mr837110pgs.141.1528361115949; Thu, 07 Jun 2018 01:45:15 -0700 (PDT) Received: from chrisp-dl.ws.atlnz.lc ([2001:df5:b000:22:3a2c:4aff:fe70:2b02]) by smtp.gmail.com with ESMTPSA id z28-v6sm59303290pfl.169.2018.06.07.01.45.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Jun 2018 01:45:15 -0700 (PDT) From: Chris Packham To: u-boot@lists.denx.de Date: Thu, 7 Jun 2018 20:45:06 +1200 Message-Id: <20180607084507.9382-1-judge.packham@gmail.com> X-Mailer: git-send-email 2.17.1 Cc: Chris Packham Subject: [U-Boot] [PATCH v3 1/2] patman: add option for limiting the Cc list X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Many mailing-lists consider a long Cc list a sign of spam and will either drop the message or mark it for moderation. Because patman automatically invokes get_maintainer.pl the Cc list can expand unexpectedly. Allow the user to specify a limit for the Cc list. This limit is applied after removing any known bouncing addresses. By default no limit is applied. Signed-off-by: Chris Packham Reviewed-by: Simon Glass --- I've fallen foul of the u-boot ML Cc limit a few times recently. I'm not sure what the actual limit is so I've left patman's default behaviour unlimited. Changes in v3: - update func_test Changes in v2: - make default None to allow limit 0 to suppress the list completely tools/patman/func_test.py | 3 ++- tools/patman/patman.py | 4 +++- tools/patman/series.py | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tools/patman/func_test.py b/tools/patman/func_test.py index 85372f3c0ade..3f7e03214470 100644 --- a/tools/patman/func_test.py +++ b/tools/patman/func_test.py @@ -149,7 +149,8 @@ class TestFunctional(unittest.TestCase): patchstream.InsertCoverLetter(cover_fname, series, count) series.DoChecks() cc_file = series.MakeCcFile(process_tags, cover_fname, - not ignore_bad_tags, add_maintainers) + not ignore_bad_tags, add_maintainers, + None) cmd = gitutil.EmailPatches(series, cover_fname, args, dry_run, not ignore_bad_tags, cc_file, in_reply_to=in_reply_to, thread=None) diff --git a/tools/patman/patman.py b/tools/patman/patman.py index 8d2c78235a7e..e01510df9c0f 100755 --- a/tools/patman/patman.py +++ b/tools/patman/patman.py @@ -38,6 +38,8 @@ parser.add_option('-i', '--ignore-errors', action='store_true', parser.add_option('-m', '--no-maintainers', action='store_false', dest='add_maintainers', default=True, help="Don't cc the file maintainers automatically") +parser.add_option('-l', '--limit-cc', dest='limit', type='int', + default=None, help='Limit the cc list to LIMIT entries [default: %default]') parser.add_option('-n', '--dry-run', action='store_true', dest='dry_run', default=False, help="Do a dry run (create but don't email patches)") parser.add_option('-p', '--project', default=project.DetectProject(), @@ -157,7 +159,7 @@ else: cc_file = series.MakeCcFile(options.process_tags, cover_fname, not options.ignore_bad_tags, - options.add_maintainers) + options.add_maintainers, options.limit) # Email the patches out (giving the user time to check / cancel) cmd = '' diff --git a/tools/patman/series.py b/tools/patman/series.py index d526d4ee91d3..2735afaf88fe 100644 --- a/tools/patman/series.py +++ b/tools/patman/series.py @@ -202,7 +202,7 @@ class Series(dict): print(col.Color(col.RED, str)) def MakeCcFile(self, process_tags, cover_fname, raise_on_error, - add_maintainers): + add_maintainers, limit): """Make a cc file for us to use for per-commit Cc automation Also stores in self._generated_cc to make ShowActions() faster. @@ -215,6 +215,7 @@ class Series(dict): add_maintainers: Either: True/False to call the get_maintainers to CC maintainers List of maintainers to include (for testing) + limit: Limit the length of the Cc list Return: Filename of temp file created """ @@ -238,6 +239,8 @@ class Series(dict): print(col.Color(col.YELLOW, 'Skipping "%s"' % x)) cc = set(cc) - set(settings.bounces) cc = [m.encode('utf-8') if type(m) != str else m for m in cc] + if limit is not None: + cc = cc[:limit] all_ccs += cc print(commit.patch, ', '.join(set(cc)), file=fd) self._generated_cc[commit.patch] = cc From patchwork Thu Jun 7 08:45:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 926207 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="fyuBeC8m"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 411fJs2Nbxz9s1B for ; Thu, 7 Jun 2018 18:46:05 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id F3FA0C22018; Thu, 7 Jun 2018 08:45:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 9A3B1C22016; Thu, 7 Jun 2018 08:45:32 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 9B59BC22028; Thu, 7 Jun 2018 08:45:24 +0000 (UTC) Received: from mail-pg0-f42.google.com (mail-pg0-f42.google.com [74.125.83.42]) by lists.denx.de (Postfix) with ESMTPS id 75E5EC21FB7 for ; Thu, 7 Jun 2018 08:45:20 +0000 (UTC) Received: by mail-pg0-f42.google.com with SMTP id m5-v6so4423702pgd.3 for ; Thu, 07 Jun 2018 01:45:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ehmeoX5Tcw2nNKmuVZrtbqgpT1ss1bVoUqWWoZHlg90=; b=fyuBeC8mDn5BCh6cJ3ycWqdQkseic5jepsOzt5Bi3PgNoKr3TipKObRtwWf3uLkAc1 5Je6N0B0hVTBYX/U+Sj7DvtULfdUiaPqadmFP70k2/s1jAcknUwD8QWbTUC+OGNqIYx4 rl5yzw26uRlnCsseRnoVpWpjyAOn06GtgGIa0y1jETSvcWtP2adSfgnaU/5QpbVwzHhE XtqoEXbAtPH2EMGx12buReu1V+YFKxi00HqPxVYDamvHWfqbRwCRTa4Sh75N39f+Hf9l sSI42JjTs/sKa8j0UhXo55UOkCFE0LnX/8KjXl3Y1Tmw2eESefCHU3FCUVFHxw6xVlVx GGUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ehmeoX5Tcw2nNKmuVZrtbqgpT1ss1bVoUqWWoZHlg90=; b=ikKf0xMcoYMjK/0SzWAGSl2CbGugUTvj+nW/qlMNvy/j64NehCcomA05PgDXmFxT10 rJMsauiWq7aQ4xvoT2Y/Zz+9yv9Mp+Xf4ZjXy5CXhuSKVlAGqLt8uPjJjtaNUEyekiWA IsG41v2iI65N8rkq6Yadsg4ZAmYCksElARcJFJ37aMSC+GVbreJLxUXqAOLBvPO3sqVw MmAka3zTJdfrYIM74q8CLsfpme8GQYUTNc9k0kL5XZ30Lbyy+jxSd7hS43IyXA0DkKRk hZKu1acaNaOl6/A4TGN7hgVIWZb7N+Q2TJq/wGly3cxmFMnFT5ToPu01FqD8R88TZgdg 6X5Q== X-Gm-Message-State: APt69E2ptt1vVwAWEseZX8v/jv0yRkoQ4VsZfYcG+1cT65sK4hjLf/Sh zAi+2ycEgZAwq2oh5JihBA9G5Kw8 X-Google-Smtp-Source: ADUXVKKH31PFLaTzrE4Wky3TK+e9E8ld2Bu4Na6HQ58PMrWGEwpTvo0GF9yqx38hPNwMBxf8NCfprg== X-Received: by 2002:a63:9611:: with SMTP id c17-v6mr818465pge.361.1528361118725; Thu, 07 Jun 2018 01:45:18 -0700 (PDT) Received: from chrisp-dl.ws.atlnz.lc ([2001:df5:b000:22:3a2c:4aff:fe70:2b02]) by smtp.gmail.com with ESMTPSA id z28-v6sm59303290pfl.169.2018.06.07.01.45.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Jun 2018 01:45:18 -0700 (PDT) From: Chris Packham To: u-boot@lists.denx.de Date: Thu, 7 Jun 2018 20:45:07 +1200 Message-Id: <20180607084507.9382-2-judge.packham@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180607084507.9382-1-judge.packham@gmail.com> References: <20180607084507.9382-1-judge.packham@gmail.com> Cc: Chris Packham Subject: [U-Boot] [PATCH v3 2/2] patman: add test for SPDX license X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add a test to exercise the check for a valid SPDX license. Signed-off-by: Chris Packham Reviewed-by: Simon Glass --- This is dependent on http://patchwork.ozlabs.org/patch/914202/ I also seem to get a bunch of doctest failures due to unicode strings, e.g. File "tools/patman/settings.py", line 78, in settings._ProjectConfigParser Failed example: sorted(config.items("settings")) Expected: [('am_hero', 'True')] Got: [('am_hero', u'True') I haven't attempted to fix these as I suspect they might be python version (2.7.12 for me) and/or locale dependent. Changes in v3: - new Changes in v2: None tools/patman/test.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/tools/patman/test.py b/tools/patman/test.py index c7ba4e6bb47c..e1b94bd1a7db 100644 --- a/tools/patman/test.py +++ b/tools/patman/test.py @@ -148,7 +148,7 @@ index 0000000..2234c87 --- /dev/null +++ b/common/bootstage.c @@ -0,0 +1,37 @@ -+// SPDX-License-Identifier: GPL-2.0+ ++%s +/* + * Copyright (c) 2011, Google Inc. All rights reserved. + * @@ -189,19 +189,22 @@ index 0000000..2234c87 1.7.3.1 ''' signoff = 'Signed-off-by: Simon Glass \n' + license = '// SPDX-License-Identifier: GPL-2.0+' tab = ' ' indent = ' ' if data_type == 'good': pass elif data_type == 'no-signoff': signoff = '' + elif data_type == 'no-license': + license = '' elif data_type == 'spaces': tab = ' ' elif data_type == 'indent': indent = tab else: print('not implemented') - return data % (signoff, tab, indent, tab) + return data % (signoff, license, tab, indent, tab) def SetupData(self, data_type): inhandle, inname = tempfile.mkstemp() @@ -234,6 +237,17 @@ index 0000000..2234c87 self.assertEqual(result.lines, 62) os.remove(inf) + def testNoLicense(self): + inf = self.SetupData('no-license') + result = checkpatch.CheckPatch(inf) + self.assertEqual(result.ok, False) + self.assertEqual(len(result.problems), 1) + self.assertEqual(result.errors, 0) + self.assertEqual(result.warnings, 1) + self.assertEqual(result.checks, 0) + self.assertEqual(result.lines, 62) + os.remove(inf) + def testSpaces(self): inf = self.SetupData('spaces') result = checkpatch.CheckPatch(inf)