Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp987520ybe; Fri, 6 Sep 2019 10:09:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqx898gk72dxiBRlbrNsn1+EKYs3ygji8Fr91vI9Zw6OwY9RAaqG7pFqY53QVCP7FSO0ksFJ X-Received: by 2002:a65:534c:: with SMTP id w12mr329183pgr.51.1567789761465; Fri, 06 Sep 2019 10:09:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567789761; cv=none; d=google.com; s=arc-20160816; b=LYv6m9bQTTS98TU4F+KWXGwlb1x0GCFs45DPWV1HUXnN22ov17Vh5UnfF+wO6N1NBl Q6sDjHYTN6fg18IF/doPIujhqnF8p8DraKBUJiEfmHu6vyFcuHwv1W51ORHeho0KaXCU +kA+LBSBjfX0l/KYVsg5zkt+spe4MnvNr0hQxzfc1AD3jLsE4Xpqd50qiu7vf7E/el5+ hg1+BcWVntkRHOP2S+JLLajX975VWWtG/Ed1OnDU2AkmutfUTOCs+ZTx4paY+ih+ua+F dSSman6FVwqbhvs13v7niqqvP99mfNOK08F5X5eTB7dcZd82eccK7SeMDzdZOV/ZbG8Z RfVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=zrqdCZIAtuCdqvP6ElMXrKWwciDgub0e1oVmcRi8cfE=; b=U+hr72QVy9IAq11eGh2cF7gp77KzPO4ROZ07bpbfV+wlus6LmRoVqFjTXWGJnhS+7o h/pn41IZwSnJwRAJ6TVQsGFAn2LbO301jFoTHC48V98XAULCjyE5Wva5n8DaxEkOT8JJ x6cjdQRO5/S6nY38hyhnENSkAKzfqUEmyGQ86TJ0yHiZwFLTtvgoZDpgJUbARCxuxKev JatOX5iduXhPP0gJpD/JyMAyqOW5dRUBvqafSdfxrQnBWCseW67tJfwL5QRP9eYCWiqc L0CN4tX9Zm1vQ8yEMHfEpUObTFjETzZ6NEoRfZTzyU6mJb9w/BUwfIsi+WsACcRN4ITR sj+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=XdrsSrTO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bf10si5183309plb.343.2019.09.06.10.09.05; Fri, 06 Sep 2019 10:09:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=XdrsSrTO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389683AbfIFLfG (ORCPT + 99 others); Fri, 6 Sep 2019 07:35:06 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:35382 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388468AbfIFLfG (ORCPT ); Fri, 6 Sep 2019 07:35:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To: From:Date:Sender:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=zrqdCZIAtuCdqvP6ElMXrKWwciDgub0e1oVmcRi8cfE=; b=XdrsSrTOvJJ5oLyddFleIAkmH o8J+tCOH8+WP04G+51dFQb5MmdXEI73fJF5Fry5wdIbNCaaEoJr3qjr3pX6B5Yy6s5kpzKUi41YF2 Y7CEnjmv35KqV9t19p2W+7NfuZawYA/hUb7TqGcpydk/yNrEYXH0oJgHtWn6yVjUdpGMaHxTVuCQh tN+gfzzp+fCPYZ5Xxlg1akAIgHX9g1AqJlrqJSl1ELJktelbyyKQ8+BwwbBy4yT5M4qLpkm9nvZEp M6uV4SVCMl92DZ2RDftobgPMZodDjDJlNHI3Ukm5UIRsM19sFU+0ZrPxqjISiHTR57DxwvYeJs8/F fAR7OkTnQ==; Received: from [177.159.253.249] (helo=coco.lan) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1i6CW7-0004R6-Ev; Fri, 06 Sep 2019 11:35:04 +0000 Date: Fri, 6 Sep 2019 08:34:57 -0300 From: Mauro Carvalho Chehab To: Joe Perches Cc: Greg Kroah-Hartman , Linux Media Mailing List , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet , Jessica Yu , Federico Vaga , Thomas Gleixner , linux-doc@vger.kernel.org Subject: Re: [PATCH] docs: license-rules.txt: cover SPDX headers on Python scripts Message-ID: <20190906083457.7e7934ec@coco.lan> In-Reply-To: References: <20190905055614.7958918b@coco.lan> <88e638eb959095ab6657d295f9f8c27169569bf2.1567675272.git.mchehab+samsung@kernel.org> <20190905092703.GA30899@kroah.com> <20190905090701.37dcf75e@coco.lan> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Thu, 05 Sep 2019 10:45:36 -0700 Joe Perches escreveu: > On Thu, 2019-09-05 at 09:07 -0300, Mauro Carvalho Chehab wrote: > > There are currently 227 files that don't complain with the "up to line 3" > > rule, including COPYING (with should probably be excluded from the check). > > > > Patches are at: > > > > https://git.linuxtv.org/mchehab/experimental.git/log/?h=spdx_pedantic > > > > Btw, most violations are due to: > > > > /* > > * SPDX... > > Hey Mauro. > > Here's a little script to move all of the improperly located > SPDX-License-Identifier lines in [.ch] files. > > Using this command line: > > $ git grep -n 'SPDX-License-Identifier: ' -- '*.[ch]' | \ > grep -v ':1:' | perl move_spdx.pl > > and > > $ cat move_spdx.pl > while (<>) { > /^([^:]+):([^:]+):(.*)/; > my ($file, $line, $spdx) = ($1, $2, $3); > $spdx =~ s/^\s*\/?\*\s*//; > $spdx =~ s/\s*\*\/\s*$//; > if ($file =~ /\.h$/) { > $spdx = "/* $spdx */"; > } else { > $spdx = "// $spdx"; > } > open(FH, '<', $file) or die $!; > my @lines = ; > close FH; > open(FH, '>', $file) or die $!; > print FH "$spdx\n"; > my $count = 0; > foreach (@lines) { > $count++; > next if ($count == $line); > next if ($count == $line - 1 && $_ =~ /^\s*\*\s*$/); > next if ($count == $line + 1 && $_ =~ /^\s*\*\s*$/); > print FH "$_"; > } > close FH; > } > > which gives this diff for today's -next Nice script! I did some changes on it, plus one change at the pedantic mode of scripts/spdxcheck.py, and placed the corresponding patches at: https://git.linuxtv.org/mchehab/experimental.git/log/?h=spdx_pedantic With that, we now have (next-20190904): Warning: SPDX header for file Documentation/networking/caif/caif.rst is at line 2 Warning: SPDX header for file Documentation/networking/mac80211_hwsim/mac80211_hwsim.rst is at line 2 Warning: SPDX header for file tools/thermal/tmon/tmon.8 is at line 2 The first two are due to a ":orphan:" tag at the RST files. IMO, it makes sense to have this at the very beginning of the files with weren't added yet at the documentation body. Having them generating a warning is a plus. The last one is interesting... what's the "very first line" where a SPDX header tag should be on a man page? Thanks, Mauro