Mercurial > kallithea
comparison whitespacecleanup.sh @ 5330:40871e0eb13a
style: add trailing newline to files
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Fri, 31 Jul 2015 15:44:07 +0200 |
parents | 9cf229b46e49 |
children | bdfba68cdfea |
comparison
equal
deleted
inserted
replaced
5329:cd64e53de17b | 5330:40871e0eb13a |
---|---|
1 #!/bin/bash -x | 1 #!/bin/bash -x |
2 | 2 |
3 # Enforce some consistency in whitespace - just to avoid spurious whitespaces changes | 3 # Enforce some consistency in whitespace - just to avoid spurious whitespaces changes |
4 | 4 |
5 files=`hg loc '*.py' '*.html' '*.css' '*.rst' '*.txt' '*.js' | egrep -v '/lockfiles.py|LICENSE-MERGELY.html|/codemirror/|/fontello/|(graph|mergely|native.history|select2/select2|yui.flot)\.js$'` | 5 files=`hg loc '*.py' '*.html' '*.css' '*.rst' '*.txt' '*.js' | egrep -v '/lockfiles.py|LICENSE-MERGELY.html|/codemirror/|/fontello/|(graph|mergely|native.history|select2/select2|yui.flot|yui.2.9)\.js$'` |
6 sed -i "s,`printf '\t'`, ,g" $files | 6 sed -i "s,`printf '\t'`, ,g" $files |
7 sed -i "s, *$,,g" $files | 7 sed -i "s, *$,,g" $files |
8 # add trailing newline if missing: | |
9 sed -i '$a\' $files | |
8 | 10 |
9 sed -i 's,\([^ /]\){,\1 {,g' `hg loc '*.css'` | 11 sed -i 's,\([^ /]\){,\1 {,g' `hg loc '*.css'` |
10 sed -i 's|^\([^ /].*,\)\([^ ]\)|\1 \2|g' `hg loc '*.css'` | 12 sed -i 's|^\([^ /].*,\)\([^ ]\)|\1 \2|g' `hg loc '*.css'` |
11 | 13 |
12 sed -i 's/^\( [^: ]*\) *: *\([^/]\)/\1: \2/g' kallithea/public/css/{style,contextbar}.css | 14 sed -i 's/^\( [^: ]*\) *: *\([^/]\)/\1: \2/g' kallithea/public/css/{style,contextbar}.css |