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

Keep encoding and newlines intact. Fixes #115. #117

Merged
merged 1 commit into from
Apr 3, 2021

Conversation

akaihola
Copy link
Owner

@akaihola akaihola commented Apr 3, 2021

No description provided.

@akaihola akaihola linked an issue Apr 3, 2021 that may be closed by this pull request
@akaihola akaihola self-assigned this Apr 3, 2021
@akaihola akaihola added the enhancement New feature or request label Apr 3, 2021
@akaihola akaihola added this to the 1.2.3 milestone Apr 3, 2021
@akaihola akaihola force-pushed the detect-line-ending branch from 51a791c to ef21f1f Compare April 3, 2021 19:56
@sourcery-ai
Copy link

sourcery-ai bot commented Apr 3, 2021

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 4.43 ⭐ 3.89 ⭐ -0.54 👍
Method Length 55.07 ⭐ 58.90 ⭐ 3.83 👎
Working memory 10.60 😞 11.18 😞 0.58 👎
Quality 68.38% 🙂 67.89% 🙂 -0.49% 👎
Other metrics Before After Change
Lines 1204 1481 277
Changed files Quality Before Quality After Quality Change
src/darker/main.py 41.93% 😞 41.82% 😞 -0.11% 👎
src/darker/black_diff.py 80.07% ⭐ 77.90% ⭐ -2.17% 👎
src/darker/import_sorting.py 73.82% 🙂 73.61% 🙂 -0.21% 👎
src/darker/utils.py 86.42% ⭐ 82.78% ⭐ -3.64% 👎
src/darker/tests/test_black_diff.py 65.69% 🙂 63.63% 🙂 -2.06% 👎
src/darker/tests/test_git.py 64.02% 🙂 64.21% 🙂 0.19% 👍
src/darker/tests/test_import_sorting.py 74.66% 🙂 73.04% 🙂 -1.62% 👎
src/darker/tests/test_main.py 67.10% 🙂 65.22% 🙂 -1.88% 👎
src/darker/tests/test_utils.py 84.06% ⭐ 78.33% ⭐ -5.73% 👎

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 😞 212 ⛔ 18 ⛔ 27.41% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
src/darker/main.py main 16 🙂 215 ⛔ 11 😞 40.57% 😞 Try splitting into smaller methods. Extract out complex expressions
src/darker/tests/test_main.py test_main 0 ⭐ 195 😞 28 ⛔ 43.59% 😞 Try splitting into smaller methods. Extract out complex expressions
src/darker/tests/test_utils.py test_textdocument_eq 0 ⭐ 216 ⛔ 21 ⛔ 44.41% 😞 Try splitting into smaller methods. Extract out complex expressions
src/darker/tests/test_git.py test_git_get_modified_files 4 ⭐ 169 😞 17 ⛔ 47.06% 😞 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!

Let us know what you think of it by mentioning @sourcery-ai in a comment.

@akaihola akaihola merged commit dea919e into master Apr 3, 2021
@akaihola akaihola deleted the detect-line-ending branch April 3, 2021 19:59
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.

Automatically detect the proper line ending
2 participants