Re: [quicwg/base-drafts] Python linting script (#1032)

Martin Thomson <notifications@github.com> Thu, 04 January 2018 00:19 UTC

Return-Path: <noreply@github.com>
X-Original-To: quic-issues@ietfa.amsl.com
Delivered-To: quic-issues@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 9AE35127058 for <quic-issues@ietfa.amsl.com>; Wed, 3 Jan 2018 16:19:58 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.999
X-Spam-Level:
X-Spam-Status: No, score=-6.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=github.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dgVXCf9b2415 for <quic-issues@ietfa.amsl.com>; Wed, 3 Jan 2018 16:19:57 -0800 (PST)
Received: from github-smtp2a-ext-cp1-prd.iad.github.net (github-smtp2-ext8.iad.github.net [192.30.252.199]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id E782B126BF0 for <quic-issues@ietf.org>; Wed, 3 Jan 2018 16:19:56 -0800 (PST)
Date: Wed, 03 Jan 2018 16:19:56 -0800
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=github.com; s=pf2014; t=1515025196; bh=ReUHxB9cNOXKg19FEfhH7rCS0p+2/p68ED401n8YwxE=; h=From:Reply-To:To:Cc:In-Reply-To:References:Subject:List-ID: List-Archive:List-Post:List-Unsubscribe:From; b=Ujkr/I7Zwv7JmR1SKon07+hj7UETYb5yw4cJ2OWey1KkcF2AtoyYiyIm8piFn+Non M5Diyhf0FDTjsQkY1lAo/3Zh+6lz3TAfkGQwXi7pQXZzW51SXAUiwaHkT03+bBZYSI U6ng9XaZCgqoe6wrMm5NpZExYK4nxrGVZw1xR/e0=
From: Martin Thomson <notifications@github.com>
Reply-To: quicwg/base-drafts <reply+0166e4ab6c8efd9bb90296293cf3229b8727815c5aa1f28892cf000000011665352c92a169ce10f35235@reply.github.com>
To: quicwg/base-drafts <base-drafts@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Message-ID: <quicwg/base-drafts/pull/1032/review/86526456@github.com>
In-Reply-To: <quicwg/base-drafts/pull/1032@github.com>
References: <quicwg/base-drafts/pull/1032@github.com>
Subject: Re: [quicwg/base-drafts] Python linting script (#1032)
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="--==_mimepart_5a4d732c40b1f_c9a3ffad0096f2c183226"; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Precedence: list
X-GitHub-Sender: martinthomson
X-GitHub-Recipient: quic-issues
X-GitHub-Reason: subscribed
X-Auto-Response-Suppress: All
X-GitHub-Recipient-Address: quic-issues@ietf.org
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic-issues/3m0JBnARDcBn667WGbslBmiaebI>
X-BeenThere: quic-issues@ietf.org
X-Mailman-Version: 2.1.22
List-Id: Notification list for GitHub issues related to the QUIC WG <quic-issues.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/quic-issues>, <mailto:quic-issues-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/quic-issues/>
List-Post: <mailto:quic-issues@ietf.org>
List-Help: <mailto:quic-issues-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/quic-issues>, <mailto:quic-issues-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 04 Jan 2018 00:19:58 -0000

martinthomson commented on this pull request.



> +parser.add_argument('-f', dest='maxFigureLineLength', default=65)
+
+args = parser.parse_args()
+
+foundError = False
+
+for inputfile in args.files:
+    insideFigure = False
+    beforeAbstract = True
+    with open(inputfile,'U') as draft:
+        linecounter = 1
+        lines = draft.readlines()
+
+        abstract = re.compile('^--- abstract')
+        table = re.compile('^\s*(?:\||{:)')
+        figure = re.compile('^[~`]{3,}')

You can drop the `,` here.

> @@ -14,5 +14,13 @@ endif
 
 latest:: lint
 .PHONY: lint
+
+PYTHON := $(shell which python3)
+ifeq ($(PYTHON),)
+PYTHON := $(shell which python)
+endif
+
+ifneq ($(PYTHON),)

I don't think that we need this check.  We need python for xml2rfc.
  

> @@ -14,5 +14,13 @@ endif
 
 latest:: lint
 .PHONY: lint
+
+PYTHON := $(shell which python3)
+ifeq ($(PYTHON),)
+PYTHON := $(shell which python)
+endif

Try:

```make
PYTHON := $(or $(shell which python3),$(shell which python))
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/pull/1032#pullrequestreview-86526456