Patchwork [1,of,6] tests: run check-code on Python files without .py extension

login
register
mail settings
Submitter Mads Kiilerich
Date April 17, 2013, 2:11 a.m.
Message ID <bf09bf3ed39d16632351.1366164661@xps>
Download mbox | patch
Permalink /patch/1370/
State Accepted
Commit cba222f01056069a242ecdf042fd90c045f2d0ca
Headers show

Comments

Mads Kiilerich - April 17, 2013, 2:11 a.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1366162776 -7200
# Node ID bf09bf3ed39d16632351a0f5af84097483917b7f
# Parent  12acbea17625a1441503418f7f2f49aa3825cf2f
tests: run check-code on Python files without .py extension

Patch

diff --git a/contrib/simplemerge b/contrib/simplemerge
--- a/contrib/simplemerge
+++ b/contrib/simplemerge
@@ -44,7 +44,7 @@  def showhelp():
 try:
     for fp in (sys.stdin, sys.stdout, sys.stderr):
         util.setbinary(fp)
-    
+
     opts = {}
     try:
         args = fancyopts.fancyopts(sys.argv[1:], options, opts)
diff --git a/contrib/undumprevlog b/contrib/undumprevlog
--- a/contrib/undumprevlog
+++ b/contrib/undumprevlog
@@ -11,7 +11,7 @@  for fp in (sys.stdin, sys.stdout, sys.st
 
 opener = scmutil.opener('.', False)
 tr = transaction.transaction(sys.stderr.write, opener, "undump.journal")
-while 1:
+while True:
     l = sys.stdin.readline()
     if not l:
         break
diff --git a/tests/test-check-code-hg.t b/tests/test-check-code-hg.t
--- a/tests/test-check-code-hg.t
+++ b/tests/test-check-code-hg.t
@@ -11,3 +11,19 @@  New errors are not allowed. Warnings are
   $ hg manifest 2>/dev/null \
   >   | xargs "$check_code" --warnings --nolineno --per-file=0 \
   >   || false
+
+Check Python files without py extension
+
+  $ cp \
+  >   hg \
+  >   hgweb.cgi \
+  >   contrib/convert-repo \
+  >   contrib/dumprevlog \
+  >   contrib/hgweb.fcgi \
+  >   contrib/hgweb.wsgi \
+  >   contrib/simplemerge \
+  >   contrib/undumprevlog \
+  >   "$TESTTMP"/
+  $ for f in "$TESTTMP"/*; do cp "$f" "$f.py"; done
+  $ "$check_code" --warnings --nolineno --per-file=0 "$TESTTMP"/*.py \
+  >   || false