Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Conversation

@odiseo0
Copy link
Contributor

@odiseo0 odiseo0 commented Jul 12, 2022

This change is for providing an api equal to the supabase-js from the docs of Supabase here

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Jul 12, 2022

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 0.01%.

Quality metrics Before After Change
Complexity 2.98 ⭐ 2.95 ⭐ -0.03 👍
Method Length 51.43 ⭐ 52.34 ⭐ 0.91 👎
Working memory 6.49 🙂 6.46 🙂 -0.03 👍
Quality 77.66% 77.67% 0.01% 👍
Other metrics Before After Change
Lines 2159 2224 65
Changed files Quality Before Quality After Quality Change
gotrue/types.py 79.94% ⭐ 79.45% ⭐ -0.49% 👎
gotrue/_async/client.py 73.93% 🙂 73.90% 🙂 -0.03% 👎
gotrue/_sync/client.py 74.21% 🙂 74.19% 🙂 -0.02% 👎
tests/_async/test_client_with_auto_confirm_enabled.py 79.90% ⭐ 79.91% ⭐ 0.01% 👍
tests/_sync/test_client_with_auto_confirm_enabled.py 80.17% ⭐ 80.18% ⭐ 0.01% 👍

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
gotrue/_async/client.py AsyncGoTrueClient.get_session_from_url 15 🙂 219 ⛔ 14 😞 36.39% 😞 Try splitting into smaller methods. Extract out complex expressions
gotrue/_sync/client.py SyncGoTrueClient.get_session_from_url 15 🙂 217 ⛔ 14 😞 36.53% 😞 Try splitting into smaller methods. Extract out complex expressions
gotrue/_async/client.py AsyncGoTrueClient.sign_in 11 🙂 111 🙂 11 😞 55.02% 🙂 Extract out complex expressions
gotrue/_sync/client.py SyncGoTrueClient.sign_in 11 🙂 104 🙂 11 😞 55.95% 🙂 Extract out complex expressions
gotrue/_async/client.py AsyncGoTrueClient.__init__ 3 ⭐ 88 🙂 16 ⛔ 58.70% 🙂 Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

@odiseo0
Copy link
Contributor Author

odiseo0 commented Jul 12, 2022

Mmmmmm, I thought this was for Python higher than 3.7

@leynier
Copy link
Contributor

leynier commented Jul 13, 2022

You can try some like this maybe

import sys

if sys.version_info >= (3, 8):
    from typing import TypedDict
else:
    from typing_extensions import TypedDict

@odiseo0
Copy link
Contributor Author

odiseo0 commented Jul 13, 2022

Yes, will do later, thank you

@leynier
Copy link
Contributor

leynier commented Jul 13, 2022

Yes, will do later, thank you

Thank to you for the contribution 🤜🤛

@odiseo0
Copy link
Contributor Author

odiseo0 commented Jul 13, 2022

Why does it fail?

@leynier
Copy link
Contributor

leynier commented Jul 13, 2022

Why does it fail?

Because the format of the code is not correct, you can run make tests_pre_commit to check that.

@odiseo0
Copy link
Contributor Author

odiseo0 commented Jul 13, 2022

Thank you, I ran the pre-commit on all files and changed the format of the files I touched

@odiseo0
Copy link
Contributor Author

odiseo0 commented Jul 13, 2022

I was about to give up

@leynier
Copy link
Contributor

leynier commented Jul 13, 2022

Thanks very much!!!

I will merge the other PR (#130) to include the style refactors.

@leynier leynier closed this Jul 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants