Apply isort & flake8 (#312)

* Update isort settings
* Apply import sorting (isort) on all files in nyaa/
* Fixed Flake8 errors in nyaa/ (see PR for list)
* Add isort to lint.sh and requirements.txt
This commit is contained in:
Kfir Hadas
2017-07-28 20:01:19 +03:00
committed by GitHub
parent 99c052c85f
commit b992467dad
13 changed files with 82 additions and 82 deletions

12
lint.sh
View File

@@ -1,6 +1,7 @@
# Lint checker/fixer
check_paths="nyaa/ utils/"
isort_paths="nyaa/" # just nyaa/ for now
max_line_length=100
function auto_pep8() {
@@ -9,14 +10,21 @@ function auto_pep8() {
--in-place \
--pep8-passes 2000 \
--max-line-length ${max_line_length} \
--verbose
--verbose \
&& \
isort ${isort_paths}
}
function check_lint() {
pycodestyle ${check_paths} \
--show-source \
--max-line-length=${max_line_length} \
--format '%(path)s [%(row)s:%(col)s] %(code)s: %(text)s'
--format '%(path)s [%(row)s:%(col)s] %(code)s: %(text)s' \
&& \
isort ${isort_paths} \
--recursive \
--diff \
--check-only
}
# MAIN