Patchwork [08,of,11] check-code: check txt files for trailing whitespace

login
register
mail settings
Submitter Mads Kiilerich
Date April 15, 2013, 1:14 a.m.
Message ID <04d7d14de104157b3d14.1365988463@xps>
Download mbox | patch
Permalink /patch/1311/
State Accepted
Commit 170fc0949fb69f98dd8a8a493619a1b6eaea4c16
Headers show

Comments

Mads Kiilerich - April 15, 2013, 1:14 a.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1365982643 -7200
# Node ID 04d7d14de104157b3d1440c9a001c49e984b030d
# Parent  415afdd06dbd889b2c3a8b10ad2200b6b59f7c16
check-code: check txt files for trailing whitespace

Patch

diff --git a/contrib/check-code.py b/contrib/check-code.py
--- a/contrib/check-code.py
+++ b/contrib/check-code.py
@@ -237,6 +237,15 @@  pyfilters = [
           (?P=quote))""", reppython),
 ]
 
+txtfilters = []
+
+txtpats = [
+  [
+    ('\s$', 'trailing whitespace'),
+  ],
+  []
+]
+
 cpats = [
   [
     (r'//', "don't use //-style comments"),
@@ -292,6 +301,7 @@  checks = [
      inrevlogpats),
     ('layering violation ui in util', r'mercurial/util\.py', pyfilters,
      inutilpats),
+    ('txt', r'.*\.txt$', txtfilters, txtpats),
 ]
 
 class norepeatlogger(object):
diff --git a/contrib/win32/win32-build.txt b/contrib/win32/win32-build.txt
--- a/contrib/win32/win32-build.txt
+++ b/contrib/win32/win32-build.txt
@@ -24,7 +24,7 @@  matching the mercurial version you want 
       http://www.microsoft.com/downloads/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf
     for 64-bit:
       http://www.microsoft.com/downloads/details.aspx?familyid=bd2a6171-e2d6-4230-b809-9a8d7548c1b6
-      
+
   The py2exe distutils extension
       http://sourceforge.net/projects/py2exe/
 
@@ -94,7 +94,7 @@  file (x86_Microsoft.VC90.CRT_(...)_9.0.2
 amd64_Microsoft.VC90.CRT_(...)_9.0.21022.8(...).manifest for x64), copy it in the
 dist directory and rename it to Microsoft.VC90.CRT.manifest.
 
-Before building the installer, you have to build Mercurial HTML documentation 
+Before building the installer, you have to build Mercurial HTML documentation
 (or fix mercurial.iss to not reference the doc directory):
 
   cd doc
diff --git a/doc/hg.1.txt b/doc/hg.1.txt
--- a/doc/hg.1.txt
+++ b/doc/hg.1.txt
@@ -84,7 +84,7 @@  Files
     This file can be used to define local tags which are not shared among
     repositories. The file format is the same as for ``.hgtags``, but it is
     encoded using the local system encoding.
-    
+
 Some commands (e.g. revert) produce backup files ending in ``.orig``,
 if the ``.orig`` file already exists and is not tracked by Mercurial,
 it will be overwritten.
diff --git a/mercurial/help/filesets.txt b/mercurial/help/filesets.txt
--- a/mercurial/help/filesets.txt
+++ b/mercurial/help/filesets.txt
@@ -1,5 +1,5 @@ 
 Mercurial supports a functional language for selecting a set of
-files. 
+files.
 
 Like other file patterns, this pattern type is indicated by a prefix,
 'set:'. The language supports a number of predicates which are joined
diff --git a/mercurial/help/patterns.txt b/mercurial/help/patterns.txt
--- a/mercurial/help/patterns.txt
+++ b/mercurial/help/patterns.txt
@@ -7,7 +7,7 @@  patterns.
 Alternate pattern notations must be specified explicitly.
 
 .. note::
-  Patterns specified in ``.hgignore`` are not rooted. 
+  Patterns specified in ``.hgignore`` are not rooted.
   Please see :hg:`help hgignore` for details.
 
 To use a plain path name without any pattern matching, start it with
diff --git a/mercurial/help/phases.txt b/mercurial/help/phases.txt
--- a/mercurial/help/phases.txt
+++ b/mercurial/help/phases.txt
@@ -79,6 +79,6 @@  Examples
 
  - resynchronize draft changesets relative to a remote repository::
 
-     hg phase -fd 'outgoing(URL)' 
+     hg phase -fd 'outgoing(URL)'
 
 See :hg:`help phase` for more information on manually manipulating phases.