flake8-pie
flake8-pie copied to clipboard
:pizza: A flake8 extension that implements misc. lints
Since you have "`lambda: []` is equivalent to the builtin `list`", I suggest other rules with similar refactoring strategies: * `lambda: {}` is equivalent to the builtin `dict` * `lambda...
Hi, I represent https://github.com/wemake-services/wemake-python-styleguide project. Awesome tool! We have the same rules: - We disallow inconsistent returns: https://wemake-python-styleguide.readthedocs.io/en/latest/pages/violations/consistency.html#wemake_python_styleguide.violations.consistency.InconsistentReturnViolation - We disallow variables used for return only https://wemake-python-styleguide.readthedocs.io/en/latest/pages/violations/consistency.html#wemake_python_styleguide.violations.consistency.InconsistentReturnVariableViolation - We disallow...
I'm trying to package your module as rpm packag. So I'm using typical in such case build, install and test cycle used on building package from non-root account: - "setup.py...
I think this rule could be pretty general but a basic example: ```python # err for id in list({x.bar for x in foo}): ... # ok for id in {x.bar...
```python # err not foo == bar # ok foo != bar ```
```python # err class Foo(Base): def __init__(self, *args: Any, **kwargs: Any) -> None: super(Base, self).__init__(*args, **kwargs) # ok class Foo(Base): def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs)...
```python # error foo.startswith("foo") or foo.startswith("bar") # ok foo.startswith(("foo", "bar")) # error foo.endswith("foo") or foo.endswith("bar") # ok foo.endswith(("foo", "bar")) ```
```python # err redis.set(redis_key, data) redis.expire(redis_key, timedelta(days=1)) # ok redis.set(redis_key, data, ex=timedelta(days=1)) ``` Note: I think we'd want to ignore the name of the client, and look for methods `.set`...
```python # err @app.task(name="foo") def foo() -> None: ... # err @shared_task(name="foo") def foo() -> None: ... # ok @app.task(name="foo", ignore_result=True) def foo() -> None: ... # ok @shared_task(name="foo", ignore_result=True)...
probably have one for ends with as well, or maybe they can the same rule? ```python # err if re.search(r"^@.*$", foo): ... # ok if foo.startswith("@"): ... ```