Mercurial > kallithea
view scripts/whitespacecleanup.sh @ 7752:3929ff3f21c6
tests: introduce doctest_mock_ugettext to allow doctests of localized code
Future doctests will require some extra mocking, as the code-under-test uses
translation (ugettext aka '_') and its provider TurboGears2 needs a context.
Avoid this complexity by mocking ugettext as the identity function. This is
done by providing a pytest fixture 'doctest_mock_ugettext' that will mock
uggettext in the module that uses the fixture.
author | Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> |
---|---|
date | Tue, 11 Jun 2019 20:53:33 +0200 |
parents | f78aa989c9ff |
children | 5698307382de |
line wrap: on
line source
#!/bin/bash -x # Enforce some consistency in whitespace - just to avoid spurious whitespaces changes files=`hg mani | egrep -v '/fontello/|/email_templates/|(/lockfiles.py|^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)$'` sed -i "s/`printf '\r'`//g" $files sed -i -e "s,`printf '\t'`, ,g" $files sed -i -e "s, *$,,g" $files sed -i -e 's,\([^ ]\)\\$,\1 \\,g' -e 's,\(["'"'"']["'"'"']["'"'"']\) \\$,\1\\,g' $files # ensure one trailing newline - remove empty last line and make last line include trailing newline: sed -i -e '$,${/^$/d}' -e '$a\' $files sed -i -e 's,\([^ /]\){,\1 {,g' `hg loc '*.css'` sed -i -e 's|^\([^ /].*,\)\([^ ]\)|\1 \2|g' `hg loc '*.css'` hg mani | xargs chmod -x hg loc 'set:!binary()&grep("^#!")&!(**_tmpl.py)&!(**/template**)' | xargs chmod +x hg diff