diff --git a/setup.cfg b/setup.cfg index 77c2c8c..56219e0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -93,6 +93,8 @@ extend-ignore = # until after being processed by Sphinx Napoleon. # Source: https://github.com/peterjc/flake8-rst-docstrings/issues/17 RST201,RST203,RST210,RST213,RST301, + # The "too deep nesting" violation fires off "too early" and cannot be configured. + WPS220, # String constant over-use is checked visually by the programmer. WPS226, # Modules as a whole are assumed to be not "too complex". diff --git a/src/urban_meal_delivery/db/cities.py b/src/urban_meal_delivery/db/cities.py index 926b3ae..f00743f 100644 --- a/src/urban_meal_delivery/db/cities.py +++ b/src/urban_meal_delivery/db/cities.py @@ -169,15 +169,15 @@ class City(meta.Base): ) # ... and adjust the size of the red dot on the `.map`. if n_orders >= 1000: - radius = 20 # noqa:WPS220 + radius = 20 elif n_orders >= 500: - radius = 15 # noqa:WPS220 + radius = 15 elif n_orders >= 100: - radius = 10 # noqa:WPS220 + radius = 10 elif n_orders >= 10: - radius = 5 # noqa:WPS220 + radius = 5 else: - radius = 1 # noqa:WPS220 + radius = 1 tooltip += f' | n_orders={n_orders}' # noqa:WPS336 diff --git a/src/urban_meal_delivery/db/customers.py b/src/urban_meal_delivery/db/customers.py index fcbfd58..96106d1 100644 --- a/src/urban_meal_delivery/db/customers.py +++ b/src/urban_meal_delivery/db/customers.py @@ -90,15 +90,15 @@ class Customer(meta.Base): .count() ) if n_orders >= 25: - radius = 20 # noqa:WPS220 + radius = 20 elif n_orders >= 10: - radius = 15 # noqa:WPS220 + radius = 15 elif n_orders >= 5: - radius = 10 # noqa:WPS220 + radius = 10 elif n_orders > 1: - radius = 5 # noqa:WPS220 + radius = 5 else: - radius = 1 # noqa:WPS220 + radius = 1 address.draw( radius=radius, @@ -156,15 +156,15 @@ class Customer(meta.Base): .count() ) if n_orders >= 25: - radius = 20 # noqa:WPS220 + radius = 20 elif n_orders >= 10: - radius = 15 # noqa:WPS220 + radius = 15 elif n_orders >= 5: - radius = 10 # noqa:WPS220 + radius = 10 elif n_orders > 1: - radius = 5 # noqa:WPS220 + radius = 5 else: - radius = 1 # noqa:WPS220 + radius = 1 tooltip += f' | n_orders={n_orders}' # noqa:WPS336 diff --git a/src/urban_meal_delivery/db/pixels.py b/src/urban_meal_delivery/db/pixels.py index f063634..f7eb257 100644 --- a/src/urban_meal_delivery/db/pixels.py +++ b/src/urban_meal_delivery/db/pixels.py @@ -226,15 +226,15 @@ class Pixel(meta.Base): ) # ... and adjust the size of the red dot on the `.map`. if n_orders >= 1000: - radius = 20 # noqa:WPS220 + radius = 20 elif n_orders >= 500: - radius = 15 # noqa:WPS220 + radius = 15 elif n_orders >= 100: - radius = 10 # noqa:WPS220 + radius = 10 elif n_orders >= 10: - radius = 5 # noqa:WPS220 + radius = 5 else: - radius = 1 # noqa:WPS220 + radius = 1 tooltip += f' | n_orders={n_orders}' # noqa:WPS336 diff --git a/src/urban_meal_delivery/db/restaurants.py b/src/urban_meal_delivery/db/restaurants.py index 31df7f8..5a95ae1 100644 --- a/src/urban_meal_delivery/db/restaurants.py +++ b/src/urban_meal_delivery/db/restaurants.py @@ -116,15 +116,15 @@ class Restaurant(meta.Base): .count() ) if n_orders >= 25: - radius = 20 # noqa:WPS220 + radius = 20 elif n_orders >= 10: - radius = 15 # noqa:WPS220 + radius = 15 elif n_orders >= 5: - radius = 10 # noqa:WPS220 + radius = 10 elif n_orders > 1: - radius = 5 # noqa:WPS220 + radius = 5 else: - radius = 1 # noqa:WPS220 + radius = 1 address.draw( radius=radius,