Changeset - 5698307382de
[Not reviewed]
default
0 2 0
Mads Kiilerich (mads) - 7 years ago 2019-08-07 00:22:56
mads@kiilerich.com
scripts: introduce import cleanup using isort
2 files changed with 4 insertions and 0 deletions:
0 comments (0 inline, 0 general)
dev_requirements.txt
Show inline comments
 
pytest >= 3.3.0, < 4.7
 
pytest-runner < 5.2
 
pytest-sugar >= 0.7.0, < 0.10
 
pytest-benchmark < 3.3
 
pytest-localserver < 0.6
 
mock < 3.1
 
Sphinx < 1.9
 
WebTest < 2.1
 
isort == 4.3.21
scripts/whitespacecleanup.sh
Show inline comments
 
#!/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
 

	
 
# isort is installed from dev_requirements.txt
 
isort --line-width 160 --wrap-length 160 --lines-after-imports 2 `hg loc '*.py'`
 

	
 
hg diff
0 comments (0 inline, 0 general)