Skip to content

Upgrade pre-commit requirements ✨ - #154

Merged
yezz123 merged 1 commit into
mainfrom
docs
Nov 14, 2021
Merged

yezz123 merged 1 commit into
mainfrom
docs

Conversation

@yezz123

@yezz123 yezz123 commented Nov 14, 2021

Copy link
Copy Markdown
Owner

Upgrade pre-commit requirements to let the code more beautiful

@yezz123 yezz123 added the dependencies Pull requests that update a dependency file label Nov 14, 2021
@yezz123 yezz123 self-assigned this Nov 14, 2021
@pull-request-quantifier-deprecated

Copy link
Copy Markdown

This PR has 166 quantified lines of changes. In general, a change size of upto 200 lines is ideal for the best PR experience!


Quantification details

Label      : Medium
Size       : +119 -47
Percentile : 53.2%

Total files changed: 19

Change summary by file extension:
.yaml : +4 -4
.py : +115 -43

Change counts above are quantified counts, based on the PullRequestQuantifier customizations.

Why proper sizing of changes matters

Optimal pull request sizes drive a better predictable PR flow as they strike a
balance between between PR complexity and PR review overhead. PRs within the
optimal size (typical small, or medium sized PRs) mean:

  • Fast and predictable releases to production:
    • Optimal size changes are more likely to be reviewed faster with fewer
      iterations.
    • Similarity in low PR complexity drives similar review times.
  • Review quality is likely higher as complexity is lower:
    • Bugs are more likely to be detected.
    • Code inconsistencies are more likely to be detetcted.
  • Knowledge sharing is improved within the participants:
    • Small portions can be assimilated better.
  • Better engineering practices are exercised:
    • Solving big problems by dividing them in well contained, smaller problems.
    • Exercising separation of concerns within the code changes.

What can I do to optimize my changes

  • Use the PullRequestQuantifier to quantify your PR accurately
    • Create a context profile for your repo using the context generator
    • Exclude files that are not necessary to be reviewed or do not increase the review complexity. Example: Autogenerated code, docs, project IDE setting files, binaries, etc. Check out the Excluded section from your prquantifier.yaml context profile.
    • Understand your typical change complexity, drive towards the desired complexity by adjusting the label mapping in your prquantifier.yaml context profile.
    • Only use the labels that matter to you, see context specification to customize your prquantifier.yaml context profile.
  • Change your engineering behaviors
    • For PRs that fall outside of the desired spectrum, review the details and check if:
      • Your PR could be split in smaller, self-contained PRs instead
      • Your PR only solves one particular issue. (For example, don't refactor and code new features in the same PR).

How to interpret the change counts in git diff output

  • One line was added: +1 -0
  • One line was deleted: +0 -1
  • One line was modified: +1 -1 (git diff doesn't know about modified, it will
    interpret that line like one addition plus one deletion)
  • Change percentiles: Change characteristics (addition, deletion, modification)
    of this PR in relation to all other PRs within the repository.


Was this comment helpful? 👍  :ok_hand:  :thumbsdown: (Email)
Customize PullRequestQuantifier for this repository.

@codecov

codecov Bot commented Nov 14, 2021 •

Copy link
Copy Markdown

Codecov Report

Merging #154 (c910700) into main (e6f55d6) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #154   +/-   ##
=======================================
  Coverage   71.44%   71.44%           
=======================================
  Files          32       32           
  Lines        1145     1145           
  Branches       82       82           
=======================================
  Hits          818      818           
  Misses        298      298           
  Partials       29       29           
Impacted Files Coverage Δ
authx/api/users.py 59.71% <ø> (ø)
authx/core/jwt.py 96.61% <ø> (ø)
authx/core/logger.py 94.11% <ø> (ø)
authx/database/mongodb.py 33.33% <ø> (ø)
authx/models/user.py 73.03% <ø> (ø)
authx/routers/admin.py 100.00% <ø> (ø)
authx/routers/auth.py 100.00% <ø> (ø)
authx/services/admin.py 36.73% <ø> (ø)
authx/services/search.py 55.00% <ø> (ø)
authx/resources/error_messages.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e6f55d6...c910700. Read the comment docs.

@sourcery-ai

sourcery-ai Bot commented Nov 14, 2021

Copy link
Copy Markdown
Contributor

Sourcery Code Quality Report

Merging this PR leaves code quality unchanged.

Quality metrics Before After Change
Complexity 1.20 ⭐ 1.20 ⭐ 0.00
Method Length 36.77 ⭐ 36.77 ⭐ 0.00
Working memory 6.86 🙂 6.86 🙂 0.00
Quality 81.01% ⭐ 81.01% ⭐ 0.00%
Other metrics Before After Change
Lines 2757 2837 80
Changed files Quality Before Quality After Quality Change
authx/main.py 77.88% ⭐ 77.88% ⭐ 0.00%
authx/api/users.py 85.79% ⭐ 85.79% ⭐ 0.00%
authx/core/jwt.py 82.03% ⭐ 82.03% ⭐ 0.00%
authx/core/logger.py 82.98% ⭐ 82.98% ⭐ 0.00%
authx/database/mongodb.py 90.52% ⭐ 90.52% ⭐ 0.00%
authx/models/user.py 76.39% ⭐ 76.39% ⭐ 0.00%
authx/resources/error_messages.py 89.13% ⭐ 89.13% ⭐ 0.00%
authx/routers/admin.py 80.86% ⭐ 80.86% ⭐ 0.00%
authx/routers/auth.py 61.93% 🙂 61.93% 🙂 0.00%
authx/services/admin.py 86.30% ⭐ 86.30% ⭐ 0.00%
authx/services/search.py 86.98% ⭐ 86.98% ⭐ 0.00%
tests/routers/test_routers_admin.py 90.03% ⭐ 90.03% ⭐ 0.00%
tests/routers/test_routers_auth.py 86.87% ⭐ 86.87% ⭐ 0.00%
tests/routers/test_routers_password.py 84.86% ⭐ 84.86% ⭐ 0.00%
tests/routers/test_routers_search.py 89.64% ⭐ 89.64% ⭐ 0.00%
tests/routers/test_routers_social.py 71.78% 🙂 71.78% 🙂 0.00%
tests/services/test_services_auth.py 78.66% ⭐ 78.66% ⭐ 0.00%
tests/services/test_services_password.py 87.59% ⭐ 87.59% ⭐ 0.00%

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

File Function Complexity Length Working Memory Quality Recommendation
authx/routers/auth.py get_router 6 ⭐ 383 ⛔ 16 ⛔ 36.36% 😞 Try splitting into smaller methods. Extract out complex expressions
authx/main.py Authentication.__init__ 0 ⭐ 129 😞 21 ⛔ 52.43% 🙂 Try splitting into smaller methods. Extract out complex expressions
tests/services/test_services_auth.py test_register 2 ⭐ 139 😞 13 😞 56.92% 🙂 Try splitting into smaller methods. Extract out complex expressions
authx/api/users.py UsersProtectionMixin.is_bruteforce 5 ⭐ 96 🙂 10 😞 64.59% 🙂 Extract out complex expressions
tests/routers/test_routers_social.py test_callback 0 ⭐ 121 😞 10 😞 66.26% 🙂 Try splitting into smaller methods. 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!

@yezz123
yezz123 merged commit e1bdde9 into main Nov 14, 2021
@yezz123
yezz123 deleted the docs branch November 14, 2021 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file Medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant