-
Notifications
You must be signed in to change notification settings - Fork 5
Draft: Adopt wemake-python-styleguide #100
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also add a badge :)
"flake8-type-checking==3.0.0", | ||
"flake8-class-attributes-order==0.3.0", | ||
"flake8-simplify==0.21.0" | ||
"wemake-python-styleguide==1.3.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why you removed all dependencies?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I though everything is included into wemake-python-styleguid
, will double check
@@ -12,7 +12,7 @@ class BaseClientMeta(ABCMeta): | |||
specific attributes). | |||
""" | |||
|
|||
pass | |||
__slots__ = () |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was a workaround because wemake-python-styleguide
thinks empty classes are bad. I will remove it and ignore the error
for _id in ids: | ||
result.append(self._cache_data.pop(_id)) | ||
deleted_records = [] | ||
for id_ in ids: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, id_
is not very pythonic
maybe we can use identifier
, opinions?
or maybe another name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree
@@ -41,7 +41,7 @@ class ModelMetaclass(PydanticModelMetaclass): | |||
""" | |||
|
|||
def __new__(mcs, name, bases, namespace): | |||
cls = super().__new__(mcs, name, bases, namespace) | |||
target_cls = super().__new__(mcs, name, bases, namespace) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it's better to name new_cls
@@ -105,7 +105,7 @@ def save(self: _M) -> _M: | |||
data returned from the database after the save operation. | |||
|
|||
Returns: | |||
(_M): The saved model instance, updated with data from the database (e.g., | |||
(_Model): The saved model instance, updated with data from the database (e.g., |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why _Model
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it complained that _M
is too short... Initially I tought to change _M
to _Model
yet then decided to suppress the error since it does not make a lot of sense. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@darya-shynkevich but it seems that you change it only in docstring, we can change it but everywhere
@@ -21,7 +22,7 @@ def test_delete(self, supabase_client: SupabaseClient, httpx_mock: 'HTTPXMock'): | |||
httpx_mock.add_response( | |||
method="DELETE", | |||
url=httpx.URL('https://test.supabase.co/rest/v1/table_name', params={'id': 'eq.1', 'title': 'neq.test'}), | |||
status_code=200, | |||
status_code=HTTPStatus.OK, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, is there are any other constants?
like HTTP_200_OK
or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, it complained about magic numbers a lot, yet I think that it is ok to use magic numbers in tests, so I change 200
to HTTPStatus.OK
because it make sense and left all other places untouched.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@darya-shynkevich no, HTTPStatus
is better than magic numbers, keep it like this
@darya-shynkevich I've been a bit busy, sorry, are you still in? |
closes #95