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

Fix typos and add codespell pre-commit hook #521

Merged
merged 2 commits into from
Nov 27, 2022
Merged

Conversation

kianmeng
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Documentation content changes

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Nov 22, 2022

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.16%.

Quality metrics Before After Change
Complexity 4.55 ⭐ 4.63 ⭐ 0.08 👎
Method Length 47.71 ⭐ 47.66 ⭐ -0.05 👍
Working memory 3.86 ⭐ 3.91 ⭐ 0.05 👎
Quality 69.42% 🙂 69.26% 🙂 -0.16% 👎
Other metrics Before After Change
Lines 829 827 -2
Changed files Quality Before Quality After Quality Change
examples/demo.py 57.28% 🙂 57.28% 🙂 0.00%
gaphas/model.py 99.40% ⭐ 99.40% ⭐ 0.00%
gaphas/quadtree.py 76.96% ⭐ 76.48% ⭐ -0.48% 👎
gaphas/solver/constraint.py 93.39% ⭐ 93.39% ⭐ 0.00%
gaphas/tool/hover.py 89.27% ⭐ 89.27% ⭐ 0.00%

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

File Function Complexity Length Working Memory Quality Recommendation
examples/demo.py create_window 13 🙂 851 ⛔ 31.45% 😞 Try splitting into smaller methods
gaphas/quadtree.py Quadtree.add 12 🙂 109 🙂 11 😞 54.39% 🙂 Extract out complex expressions
gaphas/quadtree.py QuadtreeBucket.add 3 ⭐ 169 😞 11 😞 56.14% 🙂 Try splitting into smaller methods. Extract out complex expressions
examples/demo.py create_canvas 1 ⭐ 267 ⛔ 6 ⭐ 62.56% 🙂 Try splitting into smaller methods
gaphas/quadtree.py QuadtreeBucket.find_bucket 5 ⭐ 91 🙂 10 😞 65.30% 🙂 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!

Copy link
Member

@danyeaw danyeaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kianmeng for the updates and great idea to add the additional pre-commit hook!

@danyeaw danyeaw merged commit d200ab0 into gaphor:main Nov 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants