changeset 18960:170fc0949fb6

check-code: check txt files for trailing whitespace
author Mads Kiilerich <madski@unity3d.com>
date Mon, 15 Apr 2013 01:37:23 +0200
parents 2f6418d8a4c9
children cd1ac2e54847
files contrib/check-code.py contrib/win32/win32-build.txt doc/hg.1.txt mercurial/help/filesets.txt mercurial/help/patterns.txt mercurial/help/phases.txt
diffstat 6 files changed, 16 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/check-code.py	Mon Apr 15 01:37:23 2013 +0200
+++ b/contrib/check-code.py	Mon Apr 15 01:37:23 2013 +0200
@@ -237,6 +237,15 @@
           (?P=quote))""", reppython),
 ]
 
+txtfilters = []
+
+txtpats = [
+  [
+    ('\s$', 'trailing whitespace'),
+  ],
+  []
+]
+
 cpats = [
   [
     (r'//', "don't use //-style comments"),
@@ -292,6 +301,7 @@
      inrevlogpats),
     ('layering violation ui in util', r'mercurial/util\.py', pyfilters,
      inutilpats),
+    ('txt', r'.*\.txt$', txtfilters, txtpats),
 ]
 
 class norepeatlogger(object):
--- a/contrib/win32/win32-build.txt	Mon Apr 15 01:37:23 2013 +0200
+++ b/contrib/win32/win32-build.txt	Mon Apr 15 01:37:23 2013 +0200
@@ -24,7 +24,7 @@
       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 @@
 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
--- a/doc/hg.1.txt	Mon Apr 15 01:37:23 2013 +0200
+++ b/doc/hg.1.txt	Mon Apr 15 01:37:23 2013 +0200
@@ -84,7 +84,7 @@
     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.
--- a/mercurial/help/filesets.txt	Mon Apr 15 01:37:23 2013 +0200
+++ b/mercurial/help/filesets.txt	Mon Apr 15 01:37:23 2013 +0200
@@ -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
--- a/mercurial/help/patterns.txt	Mon Apr 15 01:37:23 2013 +0200
+++ b/mercurial/help/patterns.txt	Mon Apr 15 01:37:23 2013 +0200
@@ -7,7 +7,7 @@
 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
--- a/mercurial/help/phases.txt	Mon Apr 15 01:37:23 2013 +0200
+++ b/mercurial/help/phases.txt	Mon Apr 15 01:37:23 2013 +0200
@@ -79,6 +79,6 @@
 
  - 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.