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 #215

Merged
merged 4 commits into from
Oct 22, 2021
Merged

Conversation

akaihola
Copy link
Owner

@akaihola akaihola commented Oct 4, 2021

Unify exclusion behavior with Black: the exclude options from Black configuration only apply to directories listed on the command line, but not to files. Closes #104.

  • diff .py.*.tmp against the corresponding .py file
  • tests
  • documentation
  • change log

@akaihola akaihola added the bug Something isn't working label Oct 4, 2021
@akaihola akaihola added this to the 1.3.2 milestone Oct 4, 2021
@akaihola akaihola requested a review from Krischtopp October 4, 2021 19:04
@akaihola akaihola self-assigned this Oct 4, 2021
@akaihola akaihola marked this pull request as draft October 4, 2021 19:30
@akaihola akaihola force-pushed the filter-only-directories branch from f0b51f4 to 80a7339 Compare October 5, 2021 15:37
@akaihola akaihola force-pushed the filter-only-directories branch 2 times, most recently from ed275b4 to b3e33d5 Compare October 6, 2021 18:44
@akaihola akaihola force-pushed the filter-only-directories branch 3 times, most recently from 51306ca to 9da7a98 Compare October 17, 2021 19:14
@akaihola akaihola marked this pull request as ready for review October 18, 2021 07:40
@akaihola akaihola force-pushed the filter-only-directories branch from a7166c2 to 5de0eb3 Compare October 22, 2021 14:25
@sourcery-ai
Copy link

sourcery-ai bot commented Oct 22, 2021

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 5.38 ⭐ 5.40 ⭐ 0.02 👎
Method Length 92.37 🙂 92.73 🙂 0.36 👎
Working memory 9.36 🙂 9.45 🙂 0.09 👎
Quality 65.55% 🙂 65.24% 🙂 -0.31% 👎
Other metrics Before After Change
Lines 2555 2718 163
Changed files Quality Before Quality After Quality Change
src/darker/main.py 41.47% 😞 42.24% 😞 0.77% 👍
src/darker/black_diff.py 73.94% 🙂 72.81% 🙂 -1.13% 👎
src/darker/git.py 77.55% ⭐ 77.55% ⭐ 0.00%
src/darker/linting.py 71.34% 🙂 71.34% 🙂 0.00%
src/darker/tests/test_black_diff.py 74.96% 🙂 72.16% 🙂 -2.80% 👎
src/darker/tests/test_command_line.py 70.67% 🙂 70.60% 🙂 -0.07% 👎
src/darker/tests/test_linting.py 76.31% ⭐ 76.31% ⭐ 0.00%
src/darker/tests/test_main.py 66.24% 🙂 66.40% 🙂 0.16% 👍

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/tests/test_main.py test_main 6 ⭐ 434 ⛔ 24 ⛔ 30.58% 😞 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_command_line.py test_parse_command_line 7 ⭐ 736 ⛔ 9 🙂 44.94% 😞 Try splitting into smaller methods
src/darker/tests/test_black_diff.py test_filter_python_files 4 ⭐ 242 ⛔ 11 😞 49.82% 😞 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 8b00119 into master Oct 22, 2021
@akaihola akaihola deleted the filter-only-directories branch October 22, 2021 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

Successfully merging this pull request may close these issues.

Visual Studio Code format on save doesn't work with --diff
1 participant