enable pylint-ignore

This commit is contained in:
Manuel Barkhau 2020-07-19 21:24:40 +00:00
parent 94744a333e
commit 316fb36282
5 changed files with 25 additions and 6 deletions

View file

@ -6,6 +6,7 @@ ADD test/ test/
ADD requirements/ requirements/
ADD setup.cfg setup.cfg
ADD setup.py setup.py
ADD pylint-ignore.md pylint-ignore.md
ADD README.md README.md
ADD CHANGELOG.md CHANGELOG.md
ADD LICENSE LICENSE

View file

@ -21,6 +21,7 @@ ifndef SUPPORTED_PYTHON_VERSIONS
endif
PKG_NAME := $(PACKAGE_NAME)
MODULE_NAME := $(shell echo $(subst -,_,$(PACKAGE_NAME)) | tr A-Z a-z)
# TODO (mb 2018-09-23): Support for bash on windows
# perhaps we need to install conda using this
@ -303,14 +304,14 @@ git_hooks:
## Run isort with --check-only
.PHONY: lint_isort
lint_isort:
@printf "isort ..\n"
@printf "isort ...\n"
@$(DEV_ENV)/bin/isort \
--check-only \
--force-single-line-imports \
--length-sort \
--recursive \
--line-width=$(MAX_LINE_LEN) \
--project $(PKG_NAME) \
--project $(MODULE_NAME) \
src/ test/
@printf "\e[1F\e[9C ok\n"
@ -318,7 +319,7 @@ lint_isort:
## Run sjfmt with --check
.PHONY: lint_sjfmt
lint_sjfmt:
@printf "sjfmt ..\n"
@printf "sjfmt ...\n"
@$(DEV_ENV)/bin/sjfmt \
--target-version=py36 \
--skip-string-normalization \
@ -342,16 +343,24 @@ lint_flake8:
@printf "\e[1F\e[9C ok\n"
## Run pylint. Should not break the build yet
## Run pylint.
.PHONY: lint_pylint
lint_pylint:
@mkdir -p "reports/";
@printf "pylint ..\n";
@$(DEV_ENV)/bin/pylint-ignore --rcfile=setup.cfg src/ test/
@$(DEV_ENV)/bin/pylint-ignore --rcfile=setup.cfg \
src/ test/
@printf "\e[1F\e[9C ok\n"
## Run pylint-ignore --update-ignorefile.
.PHONY: pylint_update_ignorefile
pylint_update_ignorefile:
$(DEV_ENV)/bin/pylint-ignore --rcfile=setup.cfg \
src/ test/ --update-ignorefile
## Run flake8 linter and check for fmt
.PHONY: lint
lint: lint_isort lint_sjfmt lint_flake8 lint_pylint
@ -422,7 +431,7 @@ fmt_isort:
--length-sort \
--recursive \
--line-width=$(MAX_LINE_LEN) \
--project $(PKG_NAME) \
--project $(MODULE_NAME) \
src/ test/;

View file

@ -19,6 +19,7 @@ flake8-builtins
flake8-comprehensions
flake8-junit-report
pylint
pylint-ignore
mypy
# pylint doesn't support isort>=5 for now
# https://github.com/PyCQA/pylint/issues/3722

0
scripts/exit_0_if_empty.py Executable file → Normal file
View file

View file

@ -11,6 +11,11 @@ follow_imports = silent
strict_optional = True
ignore_missing_imports = True
show_error_codes = True
warn_unreachable = True
warn_return_any = True
warn_unused_ignores = True
warn_redundant_casts = True
[tool:isort]
known_third_party = pathlib2
@ -35,6 +40,8 @@ ignore =
E221
# Multiple spaces after operand
E222
# Missing whitespace after ','
E231
# Multiple spaces after ':'
E241
# Spaces around keyword/parameter equals
@ -142,6 +149,7 @@ disable =
logging-fstring-interpolation,
no-else-return,
no-else-raise,
too-few-public-methods,
missing-docstring,
missing-module-docstring,
missing-class-docstring,