A flake8 extension that implements misc. lints
Project description
flake8-pie
A flake8 extension that implements misc. lints
Note: flake8-pie requires Python 3.6 or greater
lints
- PIE781: You are assigning to a variable and then returning. Instead remove the assignment and return.
- PIE782: Unnecessary f-string. You can safely remove the
f
prefix.
PIE781: Assign and Return
Based on Clippy's
let_and_return
and Microsoft's TSLint rule
no-unnecessary-local-variable
.
For more info on the structure of this lint, see the accompanying blog post.
examples
# error
def foo():
x = bar()
return x
# allowed
def foo():
x, _ = bar()
return x
PIE782: No Pointless F Strings
Warn about usage of f-string without templated values.
examples
x = (
f"foo {y}", # ok
f"bar" # error
)
dev
# install dependencies
poetry install
# install plugin to work with flake8
poetry run python setup.py install
# test
poetry run pytest
# or with watch
poetry run ptw
# typecheck
poetry run mypy *.py
# format
poetry run black .
# lint
poetry run flake8 .
uploading a new version to PyPi
# increment `__version__` and pyproject.toml `version`
# build new distribution files
rm -rf dist && poetry run python setup.py sdist bdist_wheel
# upload to pypi (Note: this will ask for login credentials)
poetry run twine upload dist/*
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
flake8-pie-0.2.2.tar.gz
(3.4 kB
view hashes)
Built Distribution
Close
Hashes for flake8_pie-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a53441beaca3ffb91e9aae46a1012cf3dd112f415eefa8d7ab2440878b1247a |
|
MD5 | 76402bf91cc15f985f4f836545844ddd |
|
BLAKE2b-256 | 4f264804d3904e86f0e787da0a82d1f6cd42e48dbc180c9faf2c3d90ebb78f1b |