mirror of
https://github.com/simon987/nyaa.git
synced 2025-12-16 00:09:05 +00:00
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:
12
lint.sh
12
lint.sh
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user