Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update pylint & isort #428

Merged
merged 4 commits into from
Aug 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,15 @@ disable=useless-object-inheritance,
missing-class-docstring,
# flake8 (pydocstyle) overlap
missing-function-docstring,
# needed for black formatting
bad-continuation,
# with black formatting, it is difficult to avoide this with inherited
# code or code that needs to be duplicated.
similarities,
# flake8 overlap
line-too-long
line-too-long,
# TODO remove & resolve when dropping python 2
super-with-arguments,
# TODO remove & resolve when dropping python 2
raise-missing-from

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down Expand Up @@ -470,13 +472,6 @@ max-line-length=100
# Maximum number of lines in a module
max-module-lines=1000

# List of optional constructs for which whitespace checking is disabled. `dict-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
# `empty-line` allows space-only lines.
no-space-check=trailing-comma,
dict-separator

# Allow the body of a class to be on the same line as the declaration if body
# contains single statement.
single-line-class-stmt=no
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ fix-isort: ## automatically fix all isort errors
lint: lint-isort lint-black lint-flake8 lint-pylint ## run all linters

lint-black: ## run black
@echo "Running black... If this failes, run 'make fix-black' to resolve."
@echo "Running black... If this fails, run 'make fix-black' to resolve."
@pipenv run black . --check
@echo ""

Expand All @@ -72,7 +72,7 @@ lint-flake8: ## run flake8

lint-isort: ## run isort
@echo "Running isort... If this fails, run 'make fix-isort' to resolve."
@pipenv run isort . --recursive --check-only
@pipenv run isort . --check-only
@echo ""

lint-pylint: ## run pylint
Expand All @@ -83,7 +83,7 @@ lint-pylint: ## run pylint
# linting for python 2, requires additional disables
lint_two: ## run all linters (python 2 only)
pipenv run flake8 --config=setup.cfg --exclude=runway/embedded,runway/templates --extend-ignore=D101,D202,D403,E124,E203,W504 runway
find runway -name '*.py' -not -path 'runway/embedded*' -not -path 'runway/templates/stacker/*' -not -path 'runway/templates/cdk-py/*' -not -path 'runway/blueprints/*' | xargs pipenv run pylint --rcfile=.pylintrc --disable=bad-option-value,method-hidden,relative-import
find runway -name '*.py' -not -path 'runway/embedded*' -not -path 'runway/templates/stacker/*' -not -path 'runway/templates/cdk-py/*' -not -path 'runway/blueprints/*' | xargs pipenv run pylint --rcfile=.pylintrc --disable=bad-continuation,bad-option-value,bad-whitespace,method-hidden,relative-import

test: ## run integration and unit tests
@echo "Running integration & unit tests..."
Expand Down
6 changes: 2 additions & 4 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@ importlib-resources = {version = ">=1.4", python_version = '<"3.7"'}
# Format
black = {version = "==19.10b0",python_version = '>="3.6"'} # since its pre-release, it has to be pinned this way for pipenv to install it
# Lint
isort = "<5.0.0" # v5 drops python 2 support
isort = "~=5.4.2" # v5 drops python 2 support
pylint = "~=2.6.0"
## flake8
flake8 = "~=3.8.2"
flake8-docstrings = "~=1.5.0"
pep8-naming = "~=0.11"
pydocstyle = "~=5.0.2"
## Pylint
pylint = ">=2.5.0" # pinned to avoid "Instance of '' has no 'Bucket' member"
astroid = ">=2.4.0" # https://github.com/PyCQA/pylint/issues/3134
# Test
coverage = {extras = ["toml"], version = "~=5.2.1"}
pytest = "<5.0" # last version that supports 2.7 - allows install with 2/3
Expand Down
71 changes: 37 additions & 34 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 1 addition & 15 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,12 @@ omit = ["*/runway/aws_sso_botocore/*"] # TODO remove native support is added to


[tool.isort]
force_grid_wrap = 0
include_trailing_comma = true
# TODO remove runway from known first party when isort>=5 can be used in the repo
known_first_party = ["runway"]
profile = "black"
known_local_folder = [
"jwks_rsa",
"shared",
"update_urls",
]
known_third_party = [ # most of these exist in integration_tests/ only
"jose", # not correctly identified by isort<5
"pexpect",
"prettytable",
"mypy_boto3_dynamodb", # not correctly identified by isort<5
"semver", # not correctly identified by isort<5
"send2trash",
]
line_length = 88
multi_line_output = 3
skip = [
".demo",
".eggs",
Expand All @@ -78,4 +65,3 @@ skip = [
"node_modules",
"venv",
]
use_parentheses = true