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

fix support for black 22.1 #267

Closed
wants to merge 1 commit into from
Closed

Conversation

jabesq
Copy link
Collaborator

@jabesq jabesq commented Jan 31, 2022

No description provided.

@sourcery-ai
Copy link

sourcery-ai bot commented Jan 31, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 1.49 ⭐ 1.51 ⭐ 0.02 👎
Method Length 27.78 ⭐ 28.17 ⭐ 0.39 👎
Working memory 4.60 ⭐ 4.77 ⭐ 0.17 👎
Quality 89.49% 88.89% -0.60% 👎
Other metrics Before After Change
Lines 178 179 1
Changed files Quality Before Quality After Quality Change
src/darker/config.py 91.55% ⭐ 91.25% ⭐ -0.30% 👎
src/darker/import_sorting.py 84.42% ⭐ 83.00% ⭐ -1.42% 👎

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

File Function Complexity Length Working Memory Quality Recommendation

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!

@@ -104,7 +104,8 @@ def load_config(srcs: Iterable[str]) -> DarkerConfig:
are used to look for the ``pyproject.toml`` configuration file.

"""
path = find_project_root(tuple(srcs or ["."])) / "pyproject.toml"
project_root = find_project_root(tuple(srcs or ["."]))[0]
path = project_root / "pyproject.toml"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's use find_pyproject_toml instead:

    path = find_pyproject_toml(tuple(srcs or ["."]))
    if path is not None:

Copy link
Owner

Choose a reason for hiding this comment

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

What if someone uses Darker with a Python code base which doesn't have pyproject.toml?

@akaihola
Copy link
Owner

akaihola commented Feb 2, 2022

As noted elsewhere, in #270 I took the approach of supporting both the old and the new Black behavior.

@akaihola
Copy link
Owner

akaihola commented Feb 6, 2022

#270 has been merged instead. Thank you @jabesq for your contribution nevertheless!

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.

3 participants