From 316fb36282dc861ab2c28d96f6009bcad5403d71 Mon Sep 17 00:00:00 2001 From: Manuel Barkhau Date: Sun, 19 Jul 2020 21:24:40 +0000 Subject: [PATCH] enable pylint-ignore --- Dockerfile | 1 + makefile.bootstrapit.make | 21 +++++++++++++++------ requirements/integration.txt | 1 + scripts/exit_0_if_empty.py | 0 setup.cfg | 8 ++++++++ 5 files changed, 25 insertions(+), 6 deletions(-) mode change 100755 => 100644 scripts/exit_0_if_empty.py diff --git a/Dockerfile b/Dockerfile index 067441a..1c4fe7f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/makefile.bootstrapit.make b/makefile.bootstrapit.make index 1cabe3e..1b8b0b3 100644 --- a/makefile.bootstrapit.make +++ b/makefile.bootstrapit.make @@ -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/; diff --git a/requirements/integration.txt b/requirements/integration.txt index 1b360d3..6139963 100644 --- a/requirements/integration.txt +++ b/requirements/integration.txt @@ -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 diff --git a/scripts/exit_0_if_empty.py b/scripts/exit_0_if_empty.py old mode 100755 new mode 100644 diff --git a/setup.cfg b/setup.cfg index 059b574..9fb62c2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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,