From patchwork Mon Nov 24 13:51:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mantas Mikaitis X-Patchwork-Id: 413731 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 9098A140100 for ; Tue, 25 Nov 2014 00:51:48 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:references :in-reply-to:content-type; q=dns; s=default; b=nWvOiD//q05GYHcaP neTi981XK61PPc4L338KgO+BDL3Fn/U71ytcpcLh9XcHY49GU+MYBCU+2T5gXZZa /OPAqck4AsQHEDrSA0fr0iTF6C7Cq61OLkvAp01S9UZRajzUD+hI5gIaVQcGUBpM CWkfFV5EYl/FOvBp4uOO/06+TY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:references :in-reply-to:content-type; s=default; bh=eA7tkG7Uje+NwUAi4z3apPK Qp5s=; b=vPVzghXjg1/PF/pUd2MDjld6wAVOSPgBylaeWmM0fTbjpdPOuHtNgQx p+PnIL1ptHFSGI5TeUIsn2ZbHDN04/mZqBxfAtXelqsDFKKpzj94XV4Ge6eG0ssZ F0ji0Aw1XHmVeumop9n9M/0gZFAosH+2PuwTWWfFtnfmr4Jx31VA= Received: (qmail 15702 invoked by alias); 24 Nov 2014 13:51:35 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 15625 invoked by uid 89); 24 Nov 2014 13:51:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: service87.mimecast.com Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 24 Nov 2014 13:51:33 +0000 Received: from cam-owa2.Emea.Arm.com (217.140.96.140 [217.140.96.140]) by service87.mimecast.com; Mon, 24 Nov 2014 13:51:31 +0000 Received: from e105915-lin.cambridge.arm.com ([10.1.255.212]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 24 Nov 2014 13:51:30 +0000 Message-ID: <547337E2.80000@arm.com> Date: Mon, 24 Nov 2014 13:51:30 +0000 From: Mantas Mikaitis User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org Subject: [PATCH] check_GNU_style.sh "80 characters exceeded" error fix References: <5473371E.9000904@arm.com> In-Reply-To: <5473371E.9000904@arm.com> X-Forwarded-Message-Id: <5473371E.9000904@arm.com> X-MC-Unique: 114112413513113101 X-IsSubscribed: yes check_GNU_style.sh error "Lines should not exceed 80 characters" does not return the file name and line number where error is present, only the line of code. Whereas other kind of errors return full information. This small patch will fix this and make check_GNU_style.sh return full information when patch contains lines longer than 80 errors. Tested on patches containing >80 chars lines and the script produces full information as necessary. Would this be a useful enhancement for trunk? Mantas Mikaitis gcc/ChangeLog: * contrib/check_GNU_style.sh (col): Got rid of cut operation from the pipe chain and instead added cut inside awk command. diff --git a/contrib/check_GNU_style.sh b/contrib/check_GNU_style.sh index ef8fdda..c405eeb 100755 --- a/contrib/check_GNU_style.sh +++ b/contrib/check_GNU_style.sh @@ -86,8 +86,7 @@ col (){ shift 1 grep -nH '^+' $* \ | grep -v ':+++' \ - | cut -f 2 -d '+' \ - | awk '{ if (length ($0) > 80) print $0 }' \ + | awk -F':\\+' '{ if (length($2) > 80) print $0}' \ > $tmp if [ -s $tmp ]; then printf "\n$msg\n"