kj-9 / prettymaps

A small set of Python functions to draw pretty maps from OpenStreetMap data. Based on osmnx, matplotlib and shapely libraries.
GNU Affero General Public License v3.0
0 stars 0 forks source link

add more ruff rurles #12

Closed kj-9 closed 1 year ago

kj-9 commented 1 year ago

docstring linting is currently off.

turn on ruff setting but like to use type hints for typing.

kj-9 commented 1 year ago

recommendation for ruff rules: https://www.kurusugawa.jp/20230322-ruff/

kj-9 commented 1 year ago

use typehints and docstring: https://stackoverflow.com/questions/65768215/type-annotations-with-google-style-docstrings

you can omit types in docstring

kj-9 commented 1 year ago

also try to add: B: flake8-bugbear PL: Pylint

which errors:

prettymaps/new_api.py:127:56: B008 Do not perform function call `TransformArg` in argument defaults
prettymaps/new_api.py:163:5: PLR0913 Too many arguments to function call (8 > 5)
prettymaps/new_api.py:169:12: B006 Do not use mutable data structures for argument defaults
tests/test_presets.py:13:30: PLR2004 Magic value used in comparison, consider replacing 7 with a constant variable
Found 4 errors.
kj-9 commented 1 year ago

SideNote: I noticed pylance cannot inferasdict(x).values() results for x is dataclass.

e.g. circle is defined as bool in dataclass, but inferred as Any.

スクリーンショット 2023-07-14 15 51 38
kj-9 commented 1 year ago

also add UP