view whitespacecleanup.sh @ 5021:ff4fc4b0e825

tests: Destroy user_user_group 'perms_group_1' This doesn't seem to be a problem when running `nosetests`, but with `py.test` for some reason it becomes a problem: $ py.test kallithea/tests/models/test_user_permissions_on_repo_groups.py kallithea/tests/models/test_user_group_permissions_on_repo_groups.py --maxfail=1 --tb=short ... build/bdist.macosx-10.6-intel/egg/sqlalchemy/engine/default.py:331: in do_execute cursor.execute(statement, parameters) E IntegrityError: (IntegrityError) UNIQUE constraint failed: users_groups.users_group_name u'INSERT INTO users_groups (users_group_name, user_group_description, users_group_active, users_group_inherit_default_permissions, user_id, created_on, group_data) VALUES (?, ?, ?, ?, ?, ?, ?)' ('perms_group_1', 'DESC', 1, 1, 2, '2015-04-08 17:38:03.457963', None) ...
author Marc Abramowitz <marc@marc-abramowitz.com>
date Wed, 08 Apr 2015 10:48:07 -0700
parents 9cf229b46e49
children 40871e0eb13a
line wrap: on
line source

#!/bin/bash -x

# Enforce some consistency in whitespace - just to avoid spurious whitespaces changes

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$'`
sed -i "s,`printf '\t'`,    ,g" $files
sed -i "s,  *$,,g" $files

sed -i 's,\([^ /]\){,\1 {,g' `hg loc '*.css'`
sed -i 's|^\([^ /].*,\)\([^ ]\)|\1 \2|g' `hg loc '*.css'`

sed -i 's/^\(    [^: ]*\) *: *\([^/]\)/\1: \2/g' kallithea/public/css/{style,contextbar}.css
sed -i '1s|, |,|g' kallithea/public/css/{style,contextbar}.css
sed -i 's/^\([^ ,/]\+ [^,]*[^ ,]\) *, *\(.\)/\1,\n\2/g' kallithea/public/css/{style,contextbar}.css
sed -i 's/^\([^ ,/].*\)   */\1 /g' kallithea/public/css/{style,contextbar}.css
sed -i 's,^--$,-- ,g' kallithea/templates/email_templates/main.txt

hg diff