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

No additional newline with --stdout flag. (Sourcery refactored) #261

Closed
wants to merge 3 commits into from

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Jan 23, 2022

Pull Request #257 refactored by Sourcery.

Since the original Pull Request was opened as a fork in a contributor's
repository, we are unable to create a Pull Request branching from it.

To incorporate these changes, you can either:

  1. Merge this Pull Request instead of the original, or

  2. Ask your contributor to locally incorporate these commits and push them to
    the original Pull Request

    Incorporate changes via command line
    git fetch https://github.com/akaihola/darker pull/257/head
    git merge --ff-only FETCH_HEAD
    git push

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:

Help us improve this pull request!

Because `print()` adds a newline to the end of its string argument, the
output with `--stdout` contained an additional newline compared to
the result of modifying the file.
@sourcery-ai sourcery-ai bot requested a review from magnunm January 23, 2022 14:05
@sourcery-ai sourcery-ai bot force-pushed the sourcery/pull-257 branch 3 times, most recently from ae0a7d9 to f5be4d7 Compare January 23, 2022 16:28
magnunm and others added 2 commits January 23, 2022 18:44
Unit-test for the `print_source` function used when the `--stdout`
option is applied. To test the behaviour with/without pygments the
importing of pygments was extracted to a function.
@sourcery-ai
Copy link
Author

sourcery-ai bot commented Jan 23, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 8.96 🙂 8.70 🙂 -0.26 👍
Method Length 99.39 🙂 97.55 🙂 -1.84 👍
Working memory 12.05 😞 11.98 😞 -0.07 👍
Quality 55.36% 🙂 55.90% 🙂 0.54% 👍
Other metrics Before After Change
Lines 1111 1169 58
Changed files Quality Before Quality After Quality Change
src/darker/main.py 41.03% 😞 42.15% 😞 1.12% 👍
src/darker/tests/test_main.py 67.85% 🙂 67.76% 🙂 -0.09% 👎

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 32 😞 420 ⛔ 15 😞 18.14% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
src/darker/tests/test_main.py test_main 6 ⭐ 438 ⛔ 25 ⛔ 30.22% 😞 Try splitting into smaller methods. Extract out complex expressions
src/darker/main.py _reformat_single_file 11 🙂 216 ⛔ 19 ⛔ 35.04% 😞 Try splitting into smaller methods. Extract out complex expressions
src/darker/tests/test_main.py test_format_edited_parts 0 ⭐ 197 😞 15 😞 50.76% 🙂 Try splitting into smaller methods. Extract out complex expressions
src/darker/tests/test_main.py test_reformat_single_file 0 ⭐ 113 🙂 18 ⛔ 56.42% 🙂 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 closed this Feb 2, 2022
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.

2 participants