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

Only apply Black excludes to directories (Sourcery refactored) #218

Closed

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Oct 6, 2021

Pull Request #215 refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

NOTE: As code is pushed to the original Pull Request, Sourcery will
re-run and update (force-push) this Pull Request with new refactorings as
necessary. If Sourcery finds no refactorings at any point, this Pull Request
will be closed automatically.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the filter-only-directories branch, then run:

git fetch origin sourcery/filter-only-directories
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from akaihola October 6, 2021 18:19
@akaihola akaihola force-pushed the filter-only-directories branch from 9e0a87b to ed275b4 Compare October 6, 2021 18:43
@sourcery-ai sourcery-ai bot force-pushed the sourcery/filter-only-directories branch from b9eee38 to 332ab36 Compare October 6, 2021 18:43
original_path = path_with_hash.with_suffix("")
return original_path
return path_with_hash.with_suffix("")
Copy link
Author

Choose a reason for hiding this comment

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

Function _get_rev1_path refactored with the following changes:

@sourcery-ai
Copy link
Author

sourcery-ai bot commented Oct 6, 2021

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 16.50 🙂 16.61 🙂 0.11 👎
Method Length 97.80 🙂 97.50 🙂 -0.30 👍
Working memory 13.27 😞 13.33 😞 0.06 👎
Quality 42.92% 😞 42.60% 😞 -0.32% 👎
Other metrics Before After Change
Lines 406 405 -1
Changed files Quality Before Quality After Quality Change
src/darker/main.py 42.92% 😞 42.60% 😞 -0.32% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
src/darker/main.py main 29 😞 396 ⛔ 15 😞 19.85% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
src/darker/main.py _reformat_single_file 11 🙂 209 ⛔ 18 ⛔ 36.28% 😞 Try splitting into smaller methods. Extract out complex expressions
src/darker/main.py format_edited_parts 10 🙂 78 🙂 11 😞 60.54% 🙂 Extract out complex expressions
src/darker/main.py print_diff 6 ⭐ 90 🙂 10 😞 64.47% 🙂 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!

@akaihola akaihola force-pushed the filter-only-directories branch from ed275b4 to b3e33d5 Compare October 6, 2021 18:44
@akaihola akaihola closed this Oct 6, 2021
@sourcery-ai sourcery-ai bot deleted the sourcery/filter-only-directories branch October 6, 2021 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

1 participant