Mercurial > kallithea
annotate scripts/whitespacecleanup.sh @ 9013:3a3865b4861d draft i18n tip
i18n: updated translation for German
Currently translated at 67.1% (727 of 1082 strings)
author | Kuro Chu <mitecolider@gmail.com> |
---|---|
date | Thu, 25 Jul 2024 00:00:26 +0200 |
parents | 0a84ef075575 |
children |
rev | line source |
---|---|
8340
bf85e6018daa
scripts: properly check for errors in whitespacecleanup/run-all-cleanup
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
8295
diff
changeset
|
1 #!/bin/bash -xe |
4727
9cf229b46e49
whitespacecleanup.sh - run regularly to ensure consistent spacing and avoid spurious changes
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
2 |
9cf229b46e49
whitespacecleanup.sh - run regularly to ensure consistent spacing and avoid spurious changes
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
3 # Enforce some consistency in whitespace - just to avoid spurious whitespaces changes |
9cf229b46e49
whitespacecleanup.sh - run regularly to ensure consistent spacing and avoid spurious changes
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
4 |
8770
0a84ef075575
scripts: handle running with pending deleted files
Mads Kiilerich <mads@kiilerich.com>
parents:
8652
diff
changeset
|
5 files=`hg files | egrep -v '/fontello/|/templates/email/|(^LICENSE-MERGELY.html|^docs/Makefile|^scripts/whitespacecleanup.sh|/(graph|mergely|native.history)\.js|/test_dump_html_mails.ref.html|\.png|\.gif|\.ico|\.pot|\.po|\.mo|\.tar\.gz|\.diff)$'` |
5379
1949ece749ce
cleanup: fix whitespace in CONTRIBUTORS (and other forgotten files) too
Mads Kiilerich <madski@unity3d.com>
parents:
5378
diff
changeset
|
6 |
6390
6e952212bf06
scripts: ensure unix line endings
Mads Kiilerich <mads@kiilerich.com>
parents:
6370
diff
changeset
|
7 sed -i "s/`printf '\r'`//g" $files |
5378
bdfba68cdfea
cleanup: remove empty trailing lines
Mads Kiilerich <madski@unity3d.com>
parents:
5330
diff
changeset
|
8 sed -i -e "s,`printf '\t'`, ,g" $files |
bdfba68cdfea
cleanup: remove empty trailing lines
Mads Kiilerich <madski@unity3d.com>
parents:
5330
diff
changeset
|
9 sed -i -e "s, *$,,g" $files |
5598
edb24bc0f71a
cleanup: consistent space before line continuation backslash
Mads Kiilerich <madski@unity3d.com>
parents:
5517
diff
changeset
|
10 sed -i -e 's,\([^ ]\)\\$,\1 \\,g' -e 's,\(["'"'"']["'"'"']["'"'"']\) \\$,\1\\,g' $files |
5378
bdfba68cdfea
cleanup: remove empty trailing lines
Mads Kiilerich <madski@unity3d.com>
parents:
5330
diff
changeset
|
11 # ensure one trailing newline - remove empty last line and make last line include trailing newline: |
bdfba68cdfea
cleanup: remove empty trailing lines
Mads Kiilerich <madski@unity3d.com>
parents:
5330
diff
changeset
|
12 sed -i -e '$,${/^$/d}' -e '$a\' $files |
4727
9cf229b46e49
whitespacecleanup.sh - run regularly to ensure consistent spacing and avoid spurious changes
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
13 |
8770
0a84ef075575
scripts: handle running with pending deleted files
Mads Kiilerich <mads@kiilerich.com>
parents:
8652
diff
changeset
|
14 sed -i -e 's,\([^ /]\){,\1 {,g' `hg files 'set:**.css'` |
0a84ef075575
scripts: handle running with pending deleted files
Mads Kiilerich <mads@kiilerich.com>
parents:
8652
diff
changeset
|
15 sed -i -e 's|^\([^ /].*,\)\([^ ]\)|\1 \2|g' `hg files 'set:**.css'` |
4727
9cf229b46e49
whitespacecleanup.sh - run regularly to ensure consistent spacing and avoid spurious changes
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
16 |
8770
0a84ef075575
scripts: handle running with pending deleted files
Mads Kiilerich <mads@kiilerich.com>
parents:
8652
diff
changeset
|
17 hg files | xargs chmod -x |
0a84ef075575
scripts: handle running with pending deleted files
Mads Kiilerich <mads@kiilerich.com>
parents:
8652
diff
changeset
|
18 hg files 'set:!binary()&grep("^#!")&!(**_tmpl.py)&!(**/template**)' | xargs chmod +x |
5390
530bcb645d32
cleanup: set reasonable x bits
Mads Kiilerich <madski@unity3d.com>
parents:
5379
diff
changeset
|
19 |
7810
5698307382de
scripts: introduce import cleanup using isort
Mads Kiilerich <mads@kiilerich.com>
parents:
7470
diff
changeset
|
20 # isort is installed from dev_requirements.txt |
8770
0a84ef075575
scripts: handle running with pending deleted files
Mads Kiilerich <mads@kiilerich.com>
parents:
8652
diff
changeset
|
21 hg files 'set:!binary()&grep("^#!.*python")' 'set:**.py' | xargs isort --line-width 160 --lines-after-imports 2 |
7810
5698307382de
scripts: introduce import cleanup using isort
Mads Kiilerich <mads@kiilerich.com>
parents:
7470
diff
changeset
|
22 |
8295
8d663d23ab85
scripts: make output from run-all-cleanup easier to parse
Mads Kiilerich <mads@kiilerich.com>
parents:
8288
diff
changeset
|
23 echo "diff after $0:" |
4727
9cf229b46e49
whitespacecleanup.sh - run regularly to ensure consistent spacing and avoid spurious changes
Mads Kiilerich <madski@unity3d.com>
parents:
diff
changeset
|
24 hg diff |