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 requirements/ requirements/
ADD setup.cfg setup.cfg ADD setup.cfg setup.cfg
ADD setup.py setup.py ADD setup.py setup.py
ADD pylint-ignore.md pylint-ignore.md
ADD README.md README.md ADD README.md README.md
ADD CHANGELOG.md CHANGELOG.md ADD CHANGELOG.md CHANGELOG.md
ADD LICENSE LICENSE ADD LICENSE LICENSE

View file

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

View file

@ -19,6 +19,7 @@ flake8-builtins
flake8-comprehensions flake8-comprehensions
flake8-junit-report flake8-junit-report
pylint pylint
pylint-ignore
mypy mypy
# pylint doesn't support isort>=5 for now # pylint doesn't support isort>=5 for now
# https://github.com/PyCQA/pylint/issues/3722 # 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 strict_optional = True
ignore_missing_imports = True ignore_missing_imports = True
show_error_codes = True show_error_codes = True
warn_unreachable = True
warn_return_any = True
warn_unused_ignores = True
warn_redundant_casts = True
[tool:isort] [tool:isort]
known_third_party = pathlib2 known_third_party = pathlib2
@ -35,6 +40,8 @@ ignore =
E221 E221
# Multiple spaces after operand # Multiple spaces after operand
E222 E222
# Missing whitespace after ','
E231
# Multiple spaces after ':' # Multiple spaces after ':'
E241 E241
# Spaces around keyword/parameter equals # Spaces around keyword/parameter equals
@ -142,6 +149,7 @@ disable =
logging-fstring-interpolation, logging-fstring-interpolation,
no-else-return, no-else-return,
no-else-raise, no-else-raise,
too-few-public-methods,
missing-docstring, missing-docstring,
missing-module-docstring, missing-module-docstring,
missing-class-docstring, missing-class-docstring,