Skip to content
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

✨ Use Ruff for linting #344

Merged
merged 4 commits into from
Jan 21, 2023
Merged

✨ Use Ruff for linting #344

merged 4 commits into from
Jan 21, 2023

Conversation

yezz123
Copy link
Owner

@yezz123 yezz123 commented Jan 21, 2023

No description provided.

@yezz123 yezz123 added the enhancement New feature or request label Jan 21, 2023
@yezz123 yezz123 self-assigned this Jan 21, 2023
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Jan 21, 2023

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 3.23 ⭐ 3.23 ⭐ 0.00
Method Length 48.31 ⭐ 47.89 ⭐ -0.42 👍
Working memory 5.17 ⭐ 5.17 ⭐ 0.00
Quality 73.65% 🙂 73.76% 🙂 0.11% 👍
Other metrics Before After Change
Lines 581 586 5
Changed files Quality Before Quality After Quality Change
authx/cache/config.py 87.67% ⭐ 87.67% ⭐ 0.00%
authx/core/socket.py 95.38% ⭐ 95.38% ⭐ 0.00%
authx/database/encodedb.py 81.37% ⭐ 81.37% ⭐ 0.00%
authx/middleware/Oauth2.py 54.19% 🙂 54.26% 🙂 0.07% 👍
authx/middleware/service.py 49.37% 😞 49.37% 😞 0.00%
tests/cache/test_method_cache.py 91.66% ⭐ 91.69% ⭐ 0.03% 👍
tests/core/test_core_deps_session.py 81.36% ⭐ 81.71% ⭐ 0.35% 👍
tests/core/test_core_session.py 71.06% 🙂 71.83% 🙂 0.77% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
authx/middleware/service.py cache 15 🙂 225 ⛔ 39.34% 😞 Try splitting into smaller methods
authx/middleware/Oauth2.py MiddlewareOauth2._authenticate 7 ⭐ 203 😞 14 😞 44.67% 😞 Try splitting into smaller methods. Extract out complex expressions
authx/middleware/Oauth2.py MiddlewareOauth2.__call__ 9 🙂 183 😞 10 😞 50.99% 🙂 Try splitting into smaller methods. Extract out complex expressions
authx/middleware/service.py invalidate_cache 5 ⭐ 144 😞 63.31% 🙂 Try splitting into smaller methods
tests/core/test_core_session.py testSessionStorage 2 ⭐ 150 😞 66.79% 🙂 Try splitting into smaller methods

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!

@codecov
Copy link

codecov bot commented Jan 21, 2023

Codecov Report

Base: 91.91% // Head: 91.78% // Decreases project coverage by -0.14% ⚠️

Coverage data is based on head (26f8fe1) compared to base (dc507f6).
Patch coverage: 75.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #344      +/-   ##
==========================================
- Coverage   91.91%   91.78%   -0.14%     
==========================================
  Files          58       56       -2     
  Lines        2017     1985      -32     
==========================================
- Hits         1854     1822      -32     
  Misses        163      163              
Impacted Files Coverage Δ
authx/core/socket.py 64.40% <ø> (-0.60%) ⬇️
authx/middleware/Oauth2.py 48.57% <0.00%> (ø)
authx/middleware/service.py 86.79% <ø> (ø)
tests/cache/test_method_cache.py 92.50% <100.00%> (ø)
tests/core/test_core_deps_session.py 100.00% <100.00%> (ø)
tests/core/test_core_session.py 100.00% <100.00%> (ø)
authx/__init__.py
authx/middleware/__init__.py

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@yezz123 yezz123 merged commit b9e6316 into main Jan 21, 2023
@yezz123 yezz123 deleted the support-ruff branch January 21, 2023 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant