Changeset - abb83e4edfd9
[Not reviewed]
default
0 2 0
Mads Kiilerich (mads) - 6 years ago 2020-03-06 19:37:10
mads@kiilerich.com
scripts: run isort on scripts too
2 files changed with 3 insertions and 1 deletions:
0 comments (0 inline, 0 general)
scripts/pyflakes
Show inline comments
 
#!/usr/bin/env python3
 
"""
 
pyflakes with filter configuration for Kallithea.
 
Inspired by pyflakes/api.py and flake8/plugins/pyflakes.py .
 
"""
 

	
 
import sys
 

	
 
import pyflakes.api
 
import pyflakes.messages
 

	
 

	
 
class Reporter:
 

	
 
    warned = False
 

	
 
    def flake(self, warning):
 
        # ignore known warnings
 
        if isinstance(warning, pyflakes.messages.UnusedVariable):
 
            return
 
        if warning.filename == 'kallithea/bin/kallithea_cli_ishell.py':
 
            if isinstance(warning, pyflakes.messages.ImportStarUsed) and warning.message_args == ('kallithea.model.db',):
 
                return
 
            if isinstance(warning, pyflakes.messages.UnusedImport) and warning.message_args == ('kallithea.model.db.*',):
scripts/whitespacecleanup.sh
Show inline comments
 
@@ -9,15 +9,15 @@ sed -i -e "s,`printf '\t'`,    ,g" $file
 
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 loc 'set:!binary()&grep("^#!.*python")' '*.py' | xargs isort --line-width 160 --wrap-length 160 --lines-after-imports 2
 

	
 
hg diff
0 comments (0 inline, 0 general)