shell - removing trailing whitespace for all files in ediff-trees session -
i using handy ediff-trees.el http://www.emacswiki.org/emacs/ediff-trees.el compare 2 versions of pile of python code provided 1 of project partners.
unfortunately, these guys checkin in code trailing whitespace (extra tabs here , there...) creating ton of false positive diffs, makes identifying changes , patching them on one-by-one unworkable.
does know of neat way of making emacs strip trailing whitespace lines automatically visits each of files in 2 directories comparing during execution of m-x ediff-trees.
if cannot achieved auto-magically in emacs, shell script traverses directory structure , removes trailing whitespace python source files (*.py) suffice. can run on both directories before performing diff.
apparently these options mitigate whitespace issue.
(setq ediff-diff-options "-w") (setq-default ediff-ignore-similar-regions t)
but, after testing not appear solve problem.
also, following enabled in .emacs configuration:
;; strip trailing whitespace (require 'ws-trim) (global-ws-trim-mode t) (set-default 'ws-trim-level 2)
but not effecting files visited within ediff-tree directory traversal.
[a] shell script traverses directory structure , removes trailing whitespace python source files (*.py) suffice.
this should it:
find . -name '*.py' -print0 | xargs -0 sed -i -e 's/\s\s*$//'
Comments
Post a Comment