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

Add the -d / --stdout option. Fixes #164. #165

Merged
merged 9 commits into from
Jul 30, 2021
Merged

Conversation

akaihola
Copy link
Owner

@akaihola akaihola commented Jul 17, 2021

  • decide on the design (see this comment)
  • only print out a single file
  • unit tests
  • change log

@akaihola akaihola added the enhancement New feature or request label Jul 17, 2021
@akaihola akaihola added this to the 1.3.0 milestone Jul 17, 2021
@akaihola akaihola self-assigned this Jul 17, 2021
@akaihola akaihola mentioned this pull request Jul 17, 2021
src/darker/__main__.py Outdated Show resolved Hide resolved
@akaihola akaihola force-pushed the reformat-to-stdout branch 2 times, most recently from a63d2a9 to dd4ff5a Compare July 21, 2021 19:36
Copy link
Collaborator

@levouh levouh left a comment

Choose a reason for hiding this comment

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

Useless nitpick @akaihola, going to pull/test and then I'll report back here. Otherwise LGTM.

src/darker/config.py Outdated Show resolved Hide resolved
akaihola added 6 commits July 23, 2021 00:23
This still needs refining. Currently it prints out every file which was
changed by reformatting modified lines. We probably want to only print
out a single file.
These parts will end up being refactored in #57 anyway.
@akaihola akaihola force-pushed the reformat-to-stdout branch from dd4ff5a to f4eb2c1 Compare July 23, 2021 16:43
@akaihola
Copy link
Owner Author

@levouh, I rebased on master after merging another branch.

@akaihola akaihola force-pushed the reformat-to-stdout branch from 69d6ad5 to 123a6fd Compare July 23, 2021 18:29
@sourcery-ai
Copy link

sourcery-ai bot commented Jul 23, 2021

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 4.91 ⭐ 4.93 ⭐ 0.02 👎
Method Length 100.67 🙂 96.64 🙂 -4.03 👍
Working memory 9.23 🙂 9.13 🙂 -0.10 👍
Quality 62.93% 🙂 64.35% 🙂 1.42% 👍
Other metrics Before After Change
Lines 1645 1841 196
Changed files Quality Before Quality After Quality Change
src/darker/main.py 38.07% 😞 36.17% 😞 -1.90% 👎
src/darker/command_line.py 72.65% 🙂 71.87% 🙂 -0.78% 👎
src/darker/config.py 88.87% ⭐ 91.51% ⭐ 2.64% 👍
src/darker/help.py 76.50% ⭐ 76.09% ⭐ -0.41% 👎
src/darker/tests/test_command_line.py 69.59% 🙂 69.00% 🙂 -0.59% 👎
src/darker/tests/test_config.py 65.90% 🙂 67.61% 🙂 1.71% 👍
src/darker/tests/test_main.py 67.74% 🙂 67.34% 🙂 -0.40% 👎

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 format_edited_parts 22 😞 253 ⛔ 19 ⛔ 24.23% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
src/darker/main.py main 23 😞 305 ⛔ 14 😞 26.50% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
src/darker/tests/test_main.py test_main 2 ⭐ 348 ⛔ 18 ⛔ 39.08% 😞 Try splitting into smaller methods. Extract out complex expressions
src/darker/tests/test_command_line.py test_parse_command_line 4 ⭐ 690 ⛔ 9 🙂 47.89% 😞 Try splitting into smaller methods
src/darker/tests/test_config.py test_load_config 0 ⭐ 321 ⛔ 12 😞 48.95% 😞 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!

@akaihola akaihola merged commit ef0fe9f into master Jul 30, 2021
@akaihola akaihola deleted the reformat-to-stdout branch July 30, 2021 20:19
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
Development

Successfully merging this pull request may close these issues.

2 participants