Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added checkfiles extension to check for trailing whitespace and tabs.

  • Loading branch information...
commit dfcb3e25bf54aa42db2b80c504dd95d61a94999f 1 parent af480ee
Brian McDonnell authored
Showing with 28 additions and 6 deletions.
  1. +28 −6 _hgrc
34 _hgrc
View
@@ -22,13 +22,28 @@ hgext.convert=
parentrevspec =
# Allows PS1 environment variable to be easily custonized.
prompt = ~/.hgextensions/hg-prompt/prompt.py
+# 'checkfiles' checks for tabs and trailing whitespace
+checkfiles = ~/.hgextensions/ml-hgext/checkfiles.py
-[alias]
-# Simulates git command to show contents of a changeset.
-# Combined with parentrevspec extension:
-# hg show tip^
-# shows the contents of the last committed changset
-show = log --patch --rev
+[hooks]
+# enables hook to check incoming changeset
+pretxnchangegroup.checkfiles = python:~/.hgextensions/ml-hgext/checkfiles.py:check_hook
+# enables hook to stop bad commits
+pretxncommit.checkfiles = python:~/.hgextensions/ml-hgext/checkfiles.py:check_hook
+# enables hook to fix files before creating commit
+precommit.checkfiles = python:~/.hgextensions/ml-hgext/checkfiles.py:fixup_hook
+
+[checkfiles]
+# default is any text file
+checked_exts = .c .h .cpp .xml .cs .html .js .css .txt .py .nsi .java .aspx .asp .bat .cmd .glsl
+# default are these (common autogenerated files)
+# ignored_exts = .sln .suo .vcproj .csproj .ui
+# ignored_files = foo/contains_tabs.txt bar/contains_trailing_ws.txt
+tab_size = 4
+# to examine only modified lines from check_hook (no effect on fixup_hook or command), use:
+check_diffs = True
+# to replace spaces with tabs (instead of the default: tabs -> spaces), set use_spaces = False
+use_spaces = True
[merge-tools]
threesome.executable = gvim
@@ -36,3 +51,10 @@ threesome.args = -f $base $local $other $output -c 'ThreesomeInit'
threesome.premerge = keep
threesome.priority = 1
+[alias]
+# Simulates git command to show contents of a changeset.
+# Combined with parentrevspec extension:
+# hg show tip^
+# shows the contents of the last committed changset
+show = log --patch --rev
+
Please sign in to comment.
Something went wrong with that request. Please try again.