Repository: akaihola/darker

Issue:
Missing `--jobs` support
Monitoring the resource consumption with multiple Python files staged in a pre-commit scenario, the CPU is not used very effectively, since only a single subprocess is invoked. There should be a way to parallelize the workload over separate files, utilizing all available CPU cores to achieve better performance.

Discussion:
sourcery-ai[bot]: # Sourcery Code Quality Report


✅ &nbsp;Merging this PR will **increase** code quality in the affected files by **0.13%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#complexity) | 8.44 ⭐ | 8.05 ⭐ | -0.39 👍 |
| [Method Length](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#method-length) | 60.52 ⭐ | 61.93 🙂 | 1.41 👎 |
| [Working memory](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#working-memory) | 9.52 🙂 | 9.75 🙂 | 0.23 👎 |
| **[Quality](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#quality-score)** | **62.28%** 🙂| **62.41%** 🙂| **0.13%** 👍 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 658 | 690 | 32 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 42.55% 😞 | 44.17% 😞 | 1.62% 👍|
| src/darker/command_line.py | 71.93% 🙂 | 71.23% 🙂 | -0.70% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|



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 | 26 😞 | 358 ⛔ | 16 ⛔ | 20.97% ⛔ | Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions |
| src/darker/__main__.py | \_reformat\_single\_file | 10 🙂 | 199 😞 | 18 ⛔ | 37.92% 😞 | Try splitting into smaller methods. Extract out complex expressions |
| src/darker/__main__.py | format\_edited\_parts | 8 ⭐ | 91 🙂 | 12 😞 | 58.78% 🙂 | Extract out complex expressions |
| src/darker/command_line.py | make\_argument\_parser | 1 ⭐ | 212 ⛔ | 7 🙂 | 63.16% 🙂 | Try splitting into smaller methods |
| src/darker/__main__.py | print\_diff | 5 ⭐ | 81 🙂 | 10 😞 | 66.74% 🙂 | 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](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=acdade7f5726b186f7881c426ec9103eae108b44&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


✅ &nbsp;Merging this PR will **increase** code quality in the affected files by **0.13%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#complexity) | 8.44 ⭐ | 8.05 ⭐ | -0.39 👍 |
| [Method Length](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#method-length) | 60.52 ⭐ | 61.93 🙂 | 1.41 👎 |
| [Working memory](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#working-memory) | 9.52 🙂 | 9.75 🙂 | 0.23 👎 |
| **[Quality](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#quality-score)** | **62.28%** 🙂| **62.41%** 🙂| **0.13%** 👍 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 658 | 690 | 32 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 42.55% 😞 | 44.17% 😞 | 1.62% 👍|
| src/darker/command_line.py | 71.93% 🙂 | 71.23% 🙂 | -0.70% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|



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 | 26 😞 | 358 ⛔ | 16 ⛔ | 20.97% ⛔ | Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions |
| src/darker/__main__.py | \_reformat\_single\_file | 10 🙂 | 199 😞 | 18 ⛔ | 37.92% 😞 | Try splitting into smaller methods. Extract out complex expressions |
| src/darker/__main__.py | format\_edited\_parts | 8 ⭐ | 91 🙂 | 12 😞 | 58.78% 🙂 | Extract out complex expressions |
| src/darker/command_line.py | make\_argument\_parser | 1 ⭐ | 212 ⛔ | 7 🙂 | 63.16% 🙂 | Try splitting into smaller methods |
| src/darker/__main__.py | print\_diff | 5 ⭐ | 81 🙂 | 10 😞 | 66.74% 🙂 | 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](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=acdade7f5726b186f7881c426ec9103eae108b44&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


✅ &nbsp;Merging this PR will **increase** code quality in the affected files by **0.13%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#complexity) | 8.44 ⭐ | 8.05 ⭐ | -0.39 👍 |
| [Method Length](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#method-length) | 60.52 ⭐ | 61.93 🙂 | 1.41 👎 |
| [Working memory](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#working-memory) | 9.52 🙂 | 9.75 🙂 | 0.23 👎 |
| **[Quality](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#quality-score)** | **62.28%** 🙂| **62.41%** 🙂| **0.13%** 👍 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 658 | 690 | 32 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 42.55% 😞 | 44.17% 😞 | 1.62% 👍|
| src/darker/command_line.py | 71.93% 🙂 | 71.23% 🙂 | -0.70% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|



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 | 26 😞 | 358 ⛔ | 16 ⛔ | 20.97% ⛔ | Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions |
| src/darker/__main__.py | \_reformat\_single\_file | 10 🙂 | 199 😞 | 18 ⛔ | 37.92% 😞 | Try splitting into smaller methods. Extract out complex expressions |
| src/darker/__main__.py | format\_edited\_parts | 8 ⭐ | 91 🙂 | 12 😞 | 58.78% 🙂 | Extract out complex expressions |
| src/darker/command_line.py | make\_argument\_parser | 1 ⭐ | 212 ⛔ | 7 🙂 | 63.16% 🙂 | Try splitting into smaller methods |
| src/darker/__main__.py | print\_diff | 5 ⭐ | 81 🙂 | 10 😞 | 66.74% 🙂 | 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](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=acdade7f5726b186f7881c426ec9103eae108b44&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
rogalski: @overratedpro FYI
akaihola: Hi @rogalski,

Thanks for the pull request, this is a great enhancement!

The test failure is due to an incompatibility with Black 21.8b0. I've fixed it in #183. Could you review, and rebase this on `master` after we've merged the fix? I invited you as a collaborator on this repository.
akaihola: For some reason the order in which files appear in `darker --diff` output changes with this patch. This fix is required for tests:
```diff
diff --git a/src/darker/tests/test_main_revision.py b/src/darker/tests/test_main_revision.py
index 6374551..4472236 100644
--- a/src/darker/tests/test_main_revision.py
+++ b/src/darker/tests/test_main_revision.py
@@ -43,63 +43,63 @@ from darker.tests.helpers import raises_if_exception
     dict(
         revision="",
         worktree_content=b"USERMOD=1\n",
-        expect=["+1", "+1M0", "+2-1", "+2", "+2M1-0", "+2M1"],
+        expect={"+1", "+1M0", "+2-1", "+2", "+2M1-0", "+2M1"},
     ),
     dict(
         revision="",
         worktree_content=b"ORIGINAL=1\n",
-        expect=["+1M0", "+2-1", "+2M1-0", "+2M1"],
+        expect={"+1M0", "+2-1", "+2M1-0", "+2M1"},
     ),
     dict(
         revision="",
         worktree_content=b"MODIFIED=1\n",
-        expect=["+1", "+2-1", "+2", "+2M1-0"],
+        expect={"+1", "+2-1", "+2", "+2M1-0"},
     ),
     dict(
         revision="HEAD",
         worktree_content=b"USERMOD=1\n",
-        expect=["+1", "+1M0", "+2-1", "+2", "+2M1-0", "+2M1"],
+        expect={"+1", "+1M0", "+2-1", "+2", "+2M1-0", "+2M1"},
     ),
     dict(
         revision="HEAD",
         worktree_content=b"ORIGINAL=1\n",
-        expect=["+1M0", "+2-1", "+2M1-0", "+2M1"],
+        expect={"+1M0", "+2-1", "+2M1-0", "+2M1"},
     ),
     dict(
         revision="HEAD",
         worktree_content=b"MODIFIED=1\n",
-        expect=["+1", "+2-1", "+2", "+2M1-0"],
+        expect={"+1", "+2-1", "+2", "+2M1-0"},
     ),
     dict(
         revision="HEAD^",
         worktree_content=b"USERMOD=1\n",
-        expect=["+1", "+1M0", "+2-1", "+2", "+2M1-0", "+2M1"],
+        expect={"+1", "+1M0", "+2-1", "+2", "+2M1-0", "+2M1"},
     ),
     dict(
         revision="HEAD^",
         worktree_content=b"USERMOD=1\n",
-        expect=["+1", "+1M0", "+2-1", "+2", "+2M1-0", "+2M1"],
+        expect={"+1", "+1M0", "+2-1", "+2", "+2M1-0", "+2M1"},
     ),
     dict(
         revision="HEAD^",
         worktree_content=b"ORIGINAL=1\n",
-        expect=["+2-1", "+2M1-0", "+2M1"],
+        expect={"+2-1", "+2M1-0", "+2M1"},
     ),
     dict(
         revision="HEAD^",
         worktree_content=b"MODIFIED=1\n",
-        expect=["+1", "+1M0", "+2-1", "+2"],
+        expect={"+1", "+1M0", "+2-1", "+2"},
     ),
     dict(
         revision="HEAD~2",
         worktree_content=b"USERMOD=1\n",
-        expect=["+1", "+1M0", "+2-1", "+2", "+2M1-0", "+2M1"],
+        expect={"+1", "+1M0", "+2-1", "+2", "+2M1-0", "+2M1"},
     ),
-    dict(revision="HEAD~2", worktree_content=b"ORIGINAL=1\n", expect=["+1", "+1M0"]),
+    dict(revision="HEAD~2", worktree_content=b"ORIGINAL=1\n", expect={"+1", "+1M0"}),
     dict(
         revision="HEAD~2",
         worktree_content=b"MODIFIED=1\n",
-        expect=["+1", "+1M0", "+2-1", "+2", "+2M1-0", "+2M1"],
+        expect={"+1", "+1M0", "+2-1", "+2", "+2M1-0", "+2M1"},
     ),
     dict(revision="HEAD~3", worktree_content=b"USERMOD=1\n", expect=SystemExit),
 )
@@ -141,9 +141,9 @@ def test_revision(git_repo, monkeypatch, capsys, revision, worktree_content, exp
     with raises_if_exception(expect):
         main(arguments)
 
-        modified_files = [
+        modified_files = {
             line.split("\t")[0][4:-3]
             for line in capsys.readouterr().out.splitlines()
             if line.startswith("+++ ")
-        ]
+        }
         assert modified_files == expect
```
sourcery-ai[bot]: # Sourcery Code Quality Report


✅ &nbsp;Merging this PR will **increase** code quality in the affected files by **0.14%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#complexity) | 8.46 ⭐ | 8.06 ⭐ | -0.40 👍 |
| [Method Length](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#method-length) | 60.89 ⭐ | 62.29 🙂 | 1.40 👎 |
| [Working memory](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#working-memory) | 9.53 🙂 | 9.75 🙂 | 0.22 👎 |
| **[Quality](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#quality-score)** | **62.21%** 🙂| **62.35%** 🙂| **0.14%** 👍 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 663 | 695 | 32 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 42.75% 😞 | 44.33% 😞 | 1.58% 👍|
| src/darker/command_line.py | 71.93% 🙂 | 71.23% 🙂 | -0.70% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|



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 | 26 😞 | 359 ⛔ | 16 ⛔ | 20.95% ⛔ | Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions |
| src/darker/__main__.py | \_reformat\_single\_file | 10 🙂 | 199 😞 | 18 ⛔ | 37.92% 😞 | Try splitting into smaller methods. Extract out complex expressions |
| src/darker/__main__.py | format\_edited\_parts | 8 ⭐ | 91 🙂 | 12 😞 | 58.78% 🙂 | Extract out complex expressions |
| src/darker/command_line.py | make\_argument\_parser | 1 ⭐ | 212 ⛔ | 7 🙂 | 63.16% 🙂 | Try splitting into smaller methods |
| src/darker/__main__.py | print\_diff | 6 ⭐ | 90 🙂 | 10 😞 | 64.47% 🙂 | 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](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=895a744a881560796c24934c048312eed673e323&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


✅ &nbsp;Merging this PR will **increase** code quality in the affected files by **0.14%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#complexity) | 8.46 ⭐ | 8.06 ⭐ | -0.40 👍 |
| [Method Length](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#method-length) | 60.89 ⭐ | 62.29 🙂 | 1.40 👎 |
| [Working memory](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#working-memory) | 9.53 🙂 | 9.75 🙂 | 0.22 👎 |
| **[Quality](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#quality-score)** | **62.21%** 🙂| **62.35%** 🙂| **0.14%** 👍 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 663 | 695 | 32 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 42.75% 😞 | 44.33% 😞 | 1.58% 👍|
| src/darker/command_line.py | 71.93% 🙂 | 71.23% 🙂 | -0.70% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|



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 | 26 😞 | 359 ⛔ | 16 ⛔ | 20.95% ⛔ | Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions |
| src/darker/__main__.py | \_reformat\_single\_file | 10 🙂 | 199 😞 | 18 ⛔ | 37.92% 😞 | Try splitting into smaller methods. Extract out complex expressions |
| src/darker/__main__.py | format\_edited\_parts | 8 ⭐ | 91 🙂 | 12 😞 | 58.78% 🙂 | Extract out complex expressions |
| src/darker/command_line.py | make\_argument\_parser | 1 ⭐ | 212 ⛔ | 7 🙂 | 63.16% 🙂 | Try splitting into smaller methods |
| src/darker/__main__.py | print\_diff | 6 ⭐ | 90 🙂 | 10 😞 | 64.47% 🙂 | 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](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=895a744a881560796c24934c048312eed673e323&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


✅ &nbsp;Merging this PR will **increase** code quality in the affected files by **0.03%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#complexity) | 6.26 ⭐ | 6.06 ⭐ | -0.20 👍 |
| [Method Length](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#method-length) | 91.64 🙂 | 91.84 🙂 | 0.20 👎 |
| [Working memory](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#working-memory) | 8.92 🙂 | 9.10 🙂 | 0.18 👎 |
| **[Quality](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#quality-score)** | **64.14%** 🙂| **64.17%** 🙂| **0.03%** 👍 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 1349 | 1381 | 32 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 42.75% 😞 | 44.33% 😞 | 1.58% 👍|
| src/darker/command_line.py | 71.93% 🙂 | 71.23% 🙂 | -0.70% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 70.67% 🙂 | 70.67% 🙂 | 0.00% |
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 | 26 😞 | 359 ⛔ | 16 ⛔ | 20.95% ⛔ | Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions |
| src/darker/__main__.py | \_reformat\_single\_file | 10 🙂 | 199 😞 | 18 ⛔ | 37.92% 😞 | 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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | Try splitting into smaller methods. Extract out complex expressions |
| src/darker/tests/test_command_line.py | test\_black\_options | 0 ⭐ | 225 ⛔ | 10 😞 | 56.69% 🙂 | 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](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=895a744a881560796c24934c048312eed673e323&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


✅ &nbsp;Merging this PR will **increase** code quality in the affected files by **0.10%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#complexity) | 6.26 ⭐ | 6.00 ⭐ | -0.26 👍 |
| [Method Length](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#method-length) | 91.64 🙂 | 91.81 🙂 | 0.17 👎 |
| [Working memory](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#working-memory) | 8.92 🙂 | 9.10 🙂 | 0.18 👎 |
| **[Quality](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#quality-score)** | **64.14%** 🙂| **64.24%** 🙂| **0.10%** 👍 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 1349 | 1383 | 34 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 42.75% 😞 | 44.54% 😞 | 1.79% 👍|
| src/darker/command_line.py | 71.93% 🙂 | 71.23% 🙂 | -0.70% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 70.67% 🙂 | 70.66% 🙂 | -0.01% 👎|
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 | 26 😞 | 359 ⛔ | 16 ⛔ | 20.95% ⛔ | Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions |
| src/darker/__main__.py | \_reformat\_single\_file | 10 🙂 | 199 😞 | 18 ⛔ | 37.92% 😞 | 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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | Try splitting into smaller methods. Extract out complex expressions |
| src/darker/tests/test_command_line.py | test\_black\_options | 0 ⭐ | 225 ⛔ | 10 😞 | 56.69% 🙂 | 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](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=7ab03a0d8db7ffd7378e897bf43dcd05bc73b5d3&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


✅ &nbsp;Merging this PR will **increase** code quality in the affected files by **0.10%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#complexity) | 6.26 ⭐ | 6.00 ⭐ | -0.26 👍 |
| [Method Length](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#method-length) | 91.64 🙂 | 91.81 🙂 | 0.17 👎 |
| [Working memory](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#working-memory) | 8.92 🙂 | 9.10 🙂 | 0.18 👎 |
| **[Quality](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#quality-score)** | **64.14%** 🙂| **64.24%** 🙂| **0.10%** 👍 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 1349 | 1383 | 34 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 42.75% 😞 | 44.54% 😞 | 1.79% 👍|
| src/darker/command_line.py | 71.93% 🙂 | 71.23% 🙂 | -0.70% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 70.67% 🙂 | 70.66% 🙂 | -0.01% 👎|
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 | 26 😞 | 359 ⛔ | 16 ⛔ | 20.95% ⛔ | Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions |
| src/darker/__main__.py | \_reformat\_single\_file | 10 🙂 | 199 😞 | 18 ⛔ | 37.92% 😞 | 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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | Try splitting into smaller methods. Extract out complex expressions |
| src/darker/tests/test_command_line.py | test\_black\_options | 0 ⭐ | 225 ⛔ | 10 😞 | 56.69% 🙂 | 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](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=7ab03a0d8db7ffd7378e897bf43dcd05bc73b5d3&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


✅ &nbsp;Merging this PR will **increase** code quality in the affected files by **0.10%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#complexity) | 6.26 ⭐ | 6.00 ⭐ | -0.26 👍 |
| [Method Length](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#method-length) | 91.64 🙂 | 91.81 🙂 | 0.17 👎 |
| [Working memory](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#working-memory) | 8.92 🙂 | 9.10 🙂 | 0.18 👎 |
| **[Quality](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#quality-score)** | **64.14%** 🙂| **64.24%** 🙂| **0.10%** 👍 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 1349 | 1383 | 34 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 42.75% 😞 | 44.54% 😞 | 1.79% 👍|
| src/darker/command_line.py | 71.93% 🙂 | 71.23% 🙂 | -0.70% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 70.67% 🙂 | 70.66% 🙂 | -0.01% 👎|
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 | 26 😞 | 359 ⛔ | 16 ⛔ | 20.95% ⛔ | Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions |
| src/darker/__main__.py | \_reformat\_single\_file | 10 🙂 | 199 😞 | 18 ⛔ | 37.92% 😞 | 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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | Try splitting into smaller methods. Extract out complex expressions |
| src/darker/tests/test_command_line.py | test\_black\_options | 0 ⭐ | 225 ⛔ | 10 😞 | 56.69% 🙂 | 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](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=7ab03a0d8db7ffd7378e897bf43dcd05bc73b5d3&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


✅ &nbsp;Merging this PR will **increase** code quality in the affected files by **0.10%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#complexity) | 6.26 ⭐ | 6.00 ⭐ | -0.26 👍 |
| [Method Length](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#method-length) | 91.64 🙂 | 91.81 🙂 | 0.17 👎 |
| [Working memory](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#working-memory) | 8.92 🙂 | 9.10 🙂 | 0.18 👎 |
| **[Quality](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#quality-score)** | **64.14%** 🙂| **64.24%** 🙂| **0.10%** 👍 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 1349 | 1385 | 36 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 42.75% 😞 | 44.54% 😞 | 1.79% 👍|
| src/darker/command_line.py | 71.93% 🙂 | 71.23% 🙂 | -0.70% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 70.67% 🙂 | 70.66% 🙂 | -0.01% 👎|
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 | 26 😞 | 359 ⛔ | 16 ⛔ | 20.95% ⛔ | Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions |
| src/darker/__main__.py | \_reformat\_single\_file | 10 🙂 | 199 😞 | 18 ⛔ | 37.92% 😞 | 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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | Try splitting into smaller methods. Extract out complex expressions |
| src/darker/tests/test_command_line.py | test\_black\_options | 0 ⭐ | 225 ⛔ | 10 😞 | 56.69% 🙂 | 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](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=c5749deeed39f93d6b9d6ece1cc829f32d75ea18&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


✅ &nbsp;Merging this PR will **increase** code quality in the affected files by **0.10%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#complexity) | 6.26 ⭐ | 6.00 ⭐ | -0.26 👍 |
| [Method Length](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#method-length) | 91.64 🙂 | 91.81 🙂 | 0.17 👎 |
| [Working memory](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#working-memory) | 8.92 🙂 | 9.10 🙂 | 0.18 👎 |
| **[Quality](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#quality-score)** | **64.14%** 🙂| **64.24%** 🙂| **0.10%** 👍 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 1349 | 1385 | 36 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 42.75% 😞 | 44.54% 😞 | 1.79% 👍|
| src/darker/command_line.py | 71.93% 🙂 | 71.23% 🙂 | -0.70% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 70.67% 🙂 | 70.66% 🙂 | -0.01% 👎|
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 | 26 😞 | 359 ⛔ | 16 ⛔ | 20.95% ⛔ | Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions |
| src/darker/__main__.py | \_reformat\_single\_file | 10 🙂 | 199 😞 | 18 ⛔ | 37.92% 😞 | 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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | Try splitting into smaller methods. Extract out complex expressions |
| src/darker/tests/test_command_line.py | test\_black\_options | 0 ⭐ | 225 ⛔ | 10 😞 | 56.69% 🙂 | 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](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=c5749deeed39f93d6b9d6ece1cc829f32d75ea18&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


✅ &nbsp;Merging this PR will **increase** code quality in the affected files by **0.10%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#complexity) | 6.26 ⭐ | 6.00 ⭐ | -0.26 👍 |
| [Method Length](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#method-length) | 91.64 🙂 | 91.81 🙂 | 0.17 👎 |
| [Working memory](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#working-memory) | 8.92 🙂 | 9.10 🙂 | 0.18 👎 |
| **[Quality](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#quality-score)** | **64.14%** 🙂| **64.24%** 🙂| **0.10%** 👍 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 1349 | 1385 | 36 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 42.75% 😞 | 44.54% 😞 | 1.79% 👍|
| src/darker/command_line.py | 71.93% 🙂 | 71.23% 🙂 | -0.70% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 70.67% 🙂 | 70.66% 🙂 | -0.01% 👎|
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 | 26 😞 | 359 ⛔ | 16 ⛔ | 20.95% ⛔ | Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions |
| src/darker/__main__.py | \_reformat\_single\_file | 10 🙂 | 199 😞 | 18 ⛔ | 37.92% 😞 | 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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | Try splitting into smaller methods. Extract out complex expressions |
| src/darker/tests/test_command_line.py | test\_black\_options | 0 ⭐ | 225 ⛔ | 10 😞 | 56.69% 🙂 | 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](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=c5749deeed39f93d6b9d6ece1cc829f32d75ea18&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


✅ &nbsp;Merging this PR will **increase** code quality in the affected files by **0.10%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#complexity) | 6.26 ⭐ | 6.00 ⭐ | -0.26 👍 |
| [Method Length](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#method-length) | 91.64 🙂 | 91.81 🙂 | 0.17 👎 |
| [Working memory](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#working-memory) | 8.92 🙂 | 9.10 🙂 | 0.18 👎 |
| **[Quality](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#quality-score)** | **64.14%** 🙂| **64.24%** 🙂| **0.10%** 👍 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 1349 | 1384 | 35 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 42.75% 😞 | 44.54% 😞 | 1.79% 👍|
| src/darker/command_line.py | 71.93% 🙂 | 71.23% 🙂 | -0.70% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 70.67% 🙂 | 70.66% 🙂 | -0.01% 👎|
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 | 26 😞 | 359 ⛔ | 16 ⛔ | 20.95% ⛔ | Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions |
| src/darker/__main__.py | \_reformat\_single\_file | 10 🙂 | 199 😞 | 18 ⛔ | 37.92% 😞 | 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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | Try splitting into smaller methods. Extract out complex expressions |
| src/darker/tests/test_command_line.py | test\_black\_options | 0 ⭐ | 225 ⛔ | 10 😞 | 56.69% 🙂 | 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](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=946380ba017293d7ef042f5a02409ce792aeab44&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


✅ &nbsp;Merging this PR will **increase** code quality in the affected files by **0.10%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#complexity) | 6.26 ⭐ | 6.00 ⭐ | -0.26 👍 |
| [Method Length](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#method-length) | 91.64 🙂 | 91.81 🙂 | 0.17 👎 |
| [Working memory](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#working-memory) | 8.92 🙂 | 9.10 🙂 | 0.18 👎 |
| **[Quality](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#quality-score)** | **64.14%** 🙂| **64.24%** 🙂| **0.10%** 👍 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 1349 | 1384 | 35 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 42.75% 😞 | 44.54% 😞 | 1.79% 👍|
| src/darker/command_line.py | 71.93% 🙂 | 71.23% 🙂 | -0.70% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 70.67% 🙂 | 70.66% 🙂 | -0.01% 👎|
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 | 26 😞 | 359 ⛔ | 16 ⛔ | 20.95% ⛔ | Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions |
| src/darker/__main__.py | \_reformat\_single\_file | 10 🙂 | 199 😞 | 18 ⛔ | 37.92% 😞 | 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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | Try splitting into smaller methods. Extract out complex expressions |
| src/darker/tests/test_command_line.py | test\_black\_options | 0 ⭐ | 225 ⛔ | 10 😞 | 56.69% 🙂 | 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](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=946380ba017293d7ef042f5a02409ce792aeab44&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


✅ &nbsp;Merging this PR will **increase** code quality in the affected files by **0.10%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#complexity) | 6.26 ⭐ | 6.00 ⭐ | -0.26 👍 |
| [Method Length](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#method-length) | 91.64 🙂 | 91.81 🙂 | 0.17 👎 |
| [Working memory](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#working-memory) | 8.92 🙂 | 9.10 🙂 | 0.18 👎 |
| **[Quality](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#quality-score)** | **64.14%** 🙂| **64.24%** 🙂| **0.10%** 👍 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 1349 | 1384 | 35 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 42.75% 😞 | 44.54% 😞 | 1.79% 👍|
| src/darker/command_line.py | 71.93% 🙂 | 71.23% 🙂 | -0.70% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 70.67% 🙂 | 70.66% 🙂 | -0.01% 👎|
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 | 26 😞 | 359 ⛔ | 16 ⛔ | 20.95% ⛔ | Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions |
| src/darker/__main__.py | \_reformat\_single\_file | 10 🙂 | 199 😞 | 18 ⛔ | 37.92% 😞 | 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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | Try splitting into smaller methods. Extract out complex expressions |
| src/darker/tests/test_command_line.py | test\_black\_options | 0 ⭐ | 225 ⛔ | 10 😞 | 56.69% 🙂 | 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](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=946380ba017293d7ef042f5a02409ce792aeab44&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


✅ &nbsp;Merging this PR will **increase** code quality in the affected files by **0.10%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#complexity) | 6.25 ⭐ | 5.98 ⭐ | -0.27 👍 |
| [Method Length](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#method-length) | 91.95 🙂 | 92.12 🙂 | 0.17 👎 |
| [Working memory](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#working-memory) | 8.91 🙂 | 9.09 🙂 | 0.18 👎 |
| **[Quality](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#quality-score)** | **64.09%** 🙂| **64.19%** 🙂| **0.10%** 👍 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 1364 | 1399 | 35 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 42.75% 😞 | 44.54% 😞 | 1.79% 👍|
| src/darker/command_line.py | 71.23% 🙂 | 70.55% 🙂 | -0.68% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 70.67% 🙂 | 70.66% 🙂 | -0.01% 👎|
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 | 26 😞 | 359 ⛔ | 16 ⛔ | 20.95% ⛔ | Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions |
| src/darker/__main__.py | \_reformat\_single\_file | 10 🙂 | 199 😞 | 18 ⛔ | 37.92% 😞 | 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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | Try splitting into smaller methods. Extract out complex expressions |
| src/darker/tests/test_command_line.py | test\_black\_options | 0 ⭐ | 225 ⛔ | 10 😞 | 56.69% 🙂 | 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](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=9761aec7397d725e1b57c3a43e2d5e01a0481827&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


✅ &nbsp;Merging this PR will **increase** code quality in the affected files by **0.10%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#complexity) | 6.25 ⭐ | 5.98 ⭐ | -0.27 👍 |
| [Method Length](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#method-length) | 91.95 🙂 | 92.12 🙂 | 0.17 👎 |
| [Working memory](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#working-memory) | 8.91 🙂 | 9.09 🙂 | 0.18 👎 |
| **[Quality](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#quality-score)** | **64.09%** 🙂| **64.19%** 🙂| **0.10%** 👍 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 1364 | 1399 | 35 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 42.75% 😞 | 44.54% 😞 | 1.79% 👍|
| src/darker/command_line.py | 71.23% 🙂 | 70.55% 🙂 | -0.68% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 70.67% 🙂 | 70.66% 🙂 | -0.01% 👎|
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 | 26 😞 | 359 ⛔ | 16 ⛔ | 20.95% ⛔ | Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions |
| src/darker/__main__.py | \_reformat\_single\_file | 10 🙂 | 199 😞 | 18 ⛔ | 37.92% 😞 | 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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | Try splitting into smaller methods. Extract out complex expressions |
| src/darker/tests/test_command_line.py | test\_black\_options | 0 ⭐ | 225 ⛔ | 10 😞 | 56.69% 🙂 | 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](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=9761aec7397d725e1b57c3a43e2d5e01a0481827&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


✅ &nbsp;Merging this PR will **increase** code quality in the affected files by **0.10%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#complexity) | 6.25 ⭐ | 5.98 ⭐ | -0.27 👍 |
| [Method Length](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#method-length) | 91.95 🙂 | 92.12 🙂 | 0.17 👎 |
| [Working memory](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#working-memory) | 8.91 🙂 | 9.09 🙂 | 0.18 👎 |
| **[Quality](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#quality-score)** | **64.09%** 🙂| **64.19%** 🙂| **0.10%** 👍 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 1364 | 1399 | 35 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 42.75% 😞 | 44.54% 😞 | 1.79% 👍|
| src/darker/command_line.py | 71.23% 🙂 | 70.55% 🙂 | -0.68% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 70.67% 🙂 | 70.66% 🙂 | -0.01% 👎|
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 | 26 😞 | 359 ⛔ | 16 ⛔ | 20.95% ⛔ | Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions |
| src/darker/__main__.py | \_reformat\_single\_file | 10 🙂 | 199 😞 | 18 ⛔ | 37.92% 😞 | 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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | Try splitting into smaller methods. Extract out complex expressions |
| src/darker/tests/test_command_line.py | test\_black\_options | 0 ⭐ | 225 ⛔ | 10 😞 | 56.69% 🙂 | 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](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=9761aec7397d725e1b57c3a43e2d5e01a0481827&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


✅ &nbsp;Merging this PR will **increase** code quality in the affected files by **0.10%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#complexity) | 6.25 ⭐ | 5.98 ⭐ | -0.27 👍 |
| [Method Length](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#method-length) | 91.95 🙂 | 92.12 🙂 | 0.17 👎 |
| [Working memory](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#working-memory) | 8.91 🙂 | 9.09 🙂 | 0.18 👎 |
| **[Quality](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#quality-score)** | **64.09%** 🙂| **64.19%** 🙂| **0.10%** 👍 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 1364 | 1399 | 35 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 42.75% 😞 | 44.54% 😞 | 1.79% 👍|
| src/darker/command_line.py | 71.23% 🙂 | 70.55% 🙂 | -0.68% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 70.67% 🙂 | 70.66% 🙂 | -0.01% 👎|
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 | 26 😞 | 359 ⛔ | 16 ⛔ | 20.95% ⛔ | Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions |
| src/darker/__main__.py | \_reformat\_single\_file | 10 🙂 | 199 😞 | 18 ⛔ | 37.92% 😞 | 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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | Try splitting into smaller methods. Extract out complex expressions |
| src/darker/tests/test_command_line.py | test\_black\_options | 0 ⭐ | 225 ⛔ | 10 😞 | 56.69% 🙂 | 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](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=c75cd351452615f5fe331220ce38873de5528081&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


✅ &nbsp;Merging this PR will **increase** code quality in the affected files by **0.10%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#complexity) | 6.25 ⭐ | 5.98 ⭐ | -0.27 👍 |
| [Method Length](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#method-length) | 91.95 🙂 | 92.12 🙂 | 0.17 👎 |
| [Working memory](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#working-memory) | 8.91 🙂 | 9.09 🙂 | 0.18 👎 |
| **[Quality](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#quality-score)** | **64.09%** 🙂| **64.19%** 🙂| **0.10%** 👍 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 1364 | 1399 | 35 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 42.75% 😞 | 44.54% 😞 | 1.79% 👍|
| src/darker/command_line.py | 71.23% 🙂 | 70.55% 🙂 | -0.68% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 70.67% 🙂 | 70.66% 🙂 | -0.01% 👎|
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 | 26 😞 | 359 ⛔ | 16 ⛔ | 20.95% ⛔ | Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions |
| src/darker/__main__.py | \_reformat\_single\_file | 10 🙂 | 199 😞 | 18 ⛔ | 37.92% 😞 | 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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | Try splitting into smaller methods. Extract out complex expressions |
| src/darker/tests/test_command_line.py | test\_black\_options | 0 ⭐ | 225 ⛔ | 10 😞 | 56.69% 🙂 | 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](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=c75cd351452615f5fe331220ce38873de5528081&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


✅ &nbsp;Merging this PR will **increase** code quality in the affected files by **0.10%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#complexity) | 6.25 ⭐ | 5.98 ⭐ | -0.27 👍 |
| [Method Length](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#method-length) | 91.95 🙂 | 92.12 🙂 | 0.17 👎 |
| [Working memory](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#working-memory) | 8.91 🙂 | 9.09 🙂 | 0.18 👎 |
| **[Quality](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#quality-score)** | **64.09%** 🙂| **64.19%** 🙂| **0.10%** 👍 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 1364 | 1399 | 35 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 42.75% 😞 | 44.54% 😞 | 1.79% 👍|
| src/darker/command_line.py | 71.23% 🙂 | 70.55% 🙂 | -0.68% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 70.67% 🙂 | 70.66% 🙂 | -0.01% 👎|
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 | 26 😞 | 359 ⛔ | 16 ⛔ | 20.95% ⛔ | Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions |
| src/darker/__main__.py | \_reformat\_single\_file | 10 🙂 | 199 😞 | 18 ⛔ | 37.92% 😞 | 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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | Try splitting into smaller methods. Extract out complex expressions |
| src/darker/tests/test_command_line.py | test\_black\_options | 0 ⭐ | 225 ⛔ | 10 😞 | 56.69% 🙂 | 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](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=c75cd351452615f5fe331220ce38873de5528081&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


✅ &nbsp;Merging this PR will **increase** code quality in the affected files by **0.10%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#complexity) | 6.19 ⭐ | 5.93 ⭐ | -0.26 👍 |
| [Method Length](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#method-length) | 92.14 🙂 | 92.30 🙂 | 0.16 👎 |
| [Working memory](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#working-memory) | 8.90 🙂 | 9.07 🙂 | 0.17 👎 |
| **[Quality](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report#quality-score)** | **64.26%** 🙂| **64.36%** 🙂| **0.10%** 👍 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 1366 | 1401 | 35 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 43.40% 😞 | 45.14% 😞 | 1.74% 👍|
| src/darker/command_line.py | 71.23% 🙂 | 70.55% 🙂 | -0.68% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 70.67% 🙂 | 70.66% 🙂 | -0.01% 👎|
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 | 26 😞 | 354 ⛔ | 16 ⛔ | 21.05% ⛔ | Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions |
| src/darker/__main__.py | \_reformat\_single\_file | 10 🙂 | 199 😞 | 18 ⛔ | 37.92% 😞 | 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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | Try splitting into smaller methods. Extract out complex expressions |
| src/darker/tests/test_command_line.py | test\_black\_options | 0 ⭐ | 225 ⛔ | 10 😞 | 56.69% 🙂 | 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](https://github.com/sourcery-ai/sourcery/wiki/Quality-Report) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=c87915aee017308b1c450c3c1ed1d597bd6df024&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
rogalski: @akaihola Let's postpone until we merge all of actual core performance improvements.
We need set of data (baseline + patch) which triggers pessimistic performance and/or long bisect first.
sourcery-ai[bot]: # Sourcery Code Quality Report


✅ &nbsp;Merging this PR will **increase** code quality in the affected files by **0.11%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://docs.sourcery.ai/GitHub/Quality-Report/#complexity) | 6.87 ⭐ | 6.59 ⭐ | -0.28 👍 |
| [Method Length](https://docs.sourcery.ai/GitHub/Quality-Report/#method-length) | 92.69 🙂 | 92.84 🙂 | 0.15 👎 |
| [Working memory](https://docs.sourcery.ai/GitHub/Quality-Report/#working-memory) | 8.98 🙂 | 9.16 🙂 | 0.18 👎 |
| **[Quality](https://docs.sourcery.ai/GitHub/Quality-Report/#quality-score)** | **63.47%** 🙂| **63.58%** 🙂| **0.11%** 👍 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 1379 | 1414 | 35 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 41.84% 😞 | 43.61% 😞 | 1.77% 👍|
| src/darker/command_line.py | 71.23% 🙂 | 70.55% 🙂 | -0.68% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 70.67% 🙂 | 70.66% 🙂 | -0.01% 👎|
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 😞 | 369 ⛔ | 16 ⛔ | 19.15% ⛔ | Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions |
| src/darker/__main__.py | \_reformat\_single\_file | 11 🙂 | 204 😞 | 18 ⛔ | 36.64% 😞 | 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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | Try splitting into smaller methods. Extract out complex expressions |
| src/darker/tests/test_command_line.py | test\_black\_options | 0 ⭐ | 225 ⛔ | 10 😞 | 56.69% 🙂 | 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](https://docs.sourcery.ai/GitHub/Quality-Report/) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=59b3c98d49521f314ac832ee7b55fad7c22e78d8&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


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

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://docs.sourcery.ai/GitHub/Quality-Report/#complexity) | 5.16 ⭐ | 5.14 ⭐ | -0.02 👍 |
| [Method Length](https://docs.sourcery.ai/GitHub/Quality-Report/#method-length) | 93.74 🙂 | 94.89 🙂 | 1.15 👎 |
| [Working memory](https://docs.sourcery.ai/GitHub/Quality-Report/#working-memory) | 9.59 🙂 | 9.88 😞 | 0.29 👎 |
| **[Quality](https://docs.sourcery.ai/GitHub/Quality-Report/#quality-score)** | **64.48%** 🙂| **64.17%** 🙂| **-0.31%** 👎 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 2161 | 2136 | -25 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 42.07% 😞 | 43.24% 😞 | 1.17% 👍|
| src/darker/command_line.py | 71.23% 🙂 | 70.55% 🙂 | -0.68% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 69.75% 🙂 | 69.74% 🙂 | -0.01% 👎|
| src/darker/tests/test_main.py | 67.26% 🙂 | 67.26% 🙂 | 0.00% |
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 😞 | 410 ⛔ | 17 ⛔ | 17.57% ⛔ | 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 | \_blacken\_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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | 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](https://docs.sourcery.ai/GitHub/Quality-Report/) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=c37f842e57da76f260bd5d0de305ec9f5b8f8886&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


❌ &nbsp;Merging this PR will **decrease** code quality in the affected files by **0.32%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://docs.sourcery.ai/GitHub/Quality-Report/#complexity) | 5.44 ⭐ | 5.42 ⭐ | -0.02 👍 |
| [Method Length](https://docs.sourcery.ai/GitHub/Quality-Report/#method-length) | 94.36 🙂 | 95.51 🙂 | 1.15 👎 |
| [Working memory](https://docs.sourcery.ai/GitHub/Quality-Report/#working-memory) | 9.54 🙂 | 9.83 🙂 | 0.29 👎 |
| **[Quality](https://docs.sourcery.ai/GitHub/Quality-Report/#quality-score)** | **64.39%** 🙂| **64.07%** 🙂| **-0.32%** 👎 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 2216 | 2191 | -25 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 41.04% 😞 | 42.21% 😞 | 1.17% 👍|
| src/darker/command_line.py | 71.23% 🙂 | 70.55% 🙂 | -0.68% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 69.75% 🙂 | 69.74% 🙂 | -0.01% 👎|
| src/darker/tests/test_main.py | 67.85% 🙂 | 67.85% 🙂 | 0.00% |
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 😞 | 424 ⛔ | 17 ⛔ | 15.98% ⛔ | 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 | \_blacken\_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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | 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](https://docs.sourcery.ai/GitHub/Quality-Report/) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=bc4aaf2940913976745b2818e16d3e40132f9f8c&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


❌ &nbsp;Merging this PR will **decrease** code quality in the affected files by **0.32%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://docs.sourcery.ai/GitHub/Quality-Report/#complexity) | 5.44 ⭐ | 5.42 ⭐ | -0.02 👍 |
| [Method Length](https://docs.sourcery.ai/GitHub/Quality-Report/#method-length) | 94.36 🙂 | 95.54 🙂 | 1.18 👎 |
| [Working memory](https://docs.sourcery.ai/GitHub/Quality-Report/#working-memory) | 9.54 🙂 | 9.83 🙂 | 0.29 👎 |
| **[Quality](https://docs.sourcery.ai/GitHub/Quality-Report/#quality-score)** | **64.39%** 🙂| **64.07%** 🙂| **-0.32%** 👎 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 2216 | 2193 | -23 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 41.04% 😞 | 42.20% 😞 | 1.16% 👍|
| src/darker/command_line.py | 71.23% 🙂 | 70.55% 🙂 | -0.68% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 69.75% 🙂 | 69.74% 🙂 | -0.01% 👎|
| src/darker/tests/test_main.py | 67.85% 🙂 | 67.85% 🙂 | 0.00% |
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 😞 | 426 ⛔ | 17 ⛔ | 15.96% ⛔ | 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 | \_blacken\_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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | 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](https://docs.sourcery.ai/GitHub/Quality-Report/) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=b5d0ffdbab612a6c85f1c238f24c802c490f5ead&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
akaihola: @rogalski, I found and fixed one more issue: with `--diff --jobs N ` (N>1), the diff output wouldn't be in sorted order anymore. This would cause tests to sometimes fail (see e.g. [here](https://github.com/akaihola/darker/runs/4050585415?check_suite_focus=true)), depending on timing.

Also, the `--jobs` option isn't yet documented in `README.rst` – I'll add that as well.
sourcery-ai[bot]: # Sourcery Code Quality Report


❌ &nbsp;Merging this PR will **decrease** code quality in the affected files by **0.32%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://docs.sourcery.ai/GitHub/Quality-Report/#complexity) | 5.44 ⭐ | 5.42 ⭐ | -0.02 👍 |
| [Method Length](https://docs.sourcery.ai/GitHub/Quality-Report/#method-length) | 94.36 🙂 | 95.54 🙂 | 1.18 👎 |
| [Working memory](https://docs.sourcery.ai/GitHub/Quality-Report/#working-memory) | 9.54 🙂 | 9.83 🙂 | 0.29 👎 |
| **[Quality](https://docs.sourcery.ai/GitHub/Quality-Report/#quality-score)** | **64.39%** 🙂| **64.07%** 🙂| **-0.32%** 👎 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 2216 | 2193 | -23 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 41.04% 😞 | 42.20% 😞 | 1.16% 👍|
| src/darker/command_line.py | 71.23% 🙂 | 70.55% 🙂 | -0.68% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 69.75% 🙂 | 69.74% 🙂 | -0.01% 👎|
| src/darker/tests/test_main.py | 67.85% 🙂 | 67.85% 🙂 | 0.00% |
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 😞 | 426 ⛔ | 17 ⛔ | 15.96% ⛔ | 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 | \_blacken\_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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | 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](https://docs.sourcery.ai/GitHub/Quality-Report/) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=7f37fcffc580456ad4005f359f172b979b623a68&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


❌ &nbsp;Merging this PR will **decrease** code quality in the affected files by **0.32%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://docs.sourcery.ai/GitHub/Quality-Report/#complexity) | 5.44 ⭐ | 5.42 ⭐ | -0.02 👍 |
| [Method Length](https://docs.sourcery.ai/GitHub/Quality-Report/#method-length) | 94.36 🙂 | 95.54 🙂 | 1.18 👎 |
| [Working memory](https://docs.sourcery.ai/GitHub/Quality-Report/#working-memory) | 9.54 🙂 | 9.83 🙂 | 0.29 👎 |
| **[Quality](https://docs.sourcery.ai/GitHub/Quality-Report/#quality-score)** | **64.39%** 🙂| **64.07%** 🙂| **-0.32%** 👎 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 2216 | 2193 | -23 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 41.04% 😞 | 42.20% 😞 | 1.16% 👍|
| src/darker/command_line.py | 71.23% 🙂 | 70.55% 🙂 | -0.68% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 69.75% 🙂 | 69.74% 🙂 | -0.01% 👎|
| src/darker/tests/test_main.py | 67.85% 🙂 | 67.85% 🙂 | 0.00% |
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 😞 | 426 ⛔ | 17 ⛔ | 15.96% ⛔ | 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 | \_blacken\_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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | 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](https://docs.sourcery.ai/GitHub/Quality-Report/) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=c39dd3bb8649cee47e7c4934f70e52df83f95dee&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
akaihola: @rogalski, I'm getting bad results with this branch. I ran Darker on its own codebase with `--diff --isort` 5 times with the following setups:
- `master` branch
- `jobs` branch with `--jobs 1` and `ThreadPoolExecutor`
- `jobs` branch with `--jobs 4` and `ThreadPoolExecutor`
- `jobs` branch with `--jobs 8` and `ThreadPoolExecutor`
- `jobs` branch with `--jobs 1` and `ProcessPoolExecutor`
- `jobs` branch with `--jobs 4` and `ProcessPoolExecutor`
- `jobs` branch with `--jobs 8` and `ProcessPoolExecutor`

The average results are:
- `--jobs 1` is about **30x slower** than `master` with both threads and processes
- `--jobs 4` is 5% slower than `--jobs 1` with threads
- `--jobs 8` is 7% slower than `--jobs 1` with threads
- `--jobs 4` is 6% faster than `--jobs 1` with processes
- `--jobs 8` is 5% faster than `--jobs 1` with processes

Based on the ~30x slowdown of this branch compared to `master`, I think we need to take a closer look on what on earth is going on. Maybe the code refactoring, not multiple jobs, changed the behavior somehow?

Maybe we need to profile (see #26) to understand the bottlenecks better.

In any case, processes seem to beat threads hands down.
akaihola: I made a version with a dummy executor like this:
```python
class DummyExecutor(concurrent.futures.Executor):
    def __init__(self, max_workers=None):
        self._shutdown = False

    def submit(self, fn, *args, **kwargs):
        if self._shutdown:
            raise RuntimeError("cannot schedule new futures after shutdown")

        f = concurrent.futures.Future()
        try:
            result = fn(*args, **kwargs)
        except BaseException as e:
            f.set_exception(e)
        else:
            f.set_result(result)

        return f

    def shutdown(self, wait=True):
        self._shutdown = True
```

This time I ran without `--lint pylint`, and compared to `master`:
- `DummyExecutor` is **4.8x slower**
- `ThreadPoolExecutor` with `--jobs 1` is 4.6x slower
- `ProcessPoolExecutor` with `--jobs 1` is 5.7x slower

So obviously the refactoring somehow adds a 3.8x overhead. I'll review the code again and try to understand what is causing that.
akaihola: I verified that sorting of the files I added in b5d0ffdbab612a6c85f1c238f24c802c490f5ead didn't affect performance.
sourcery-ai[bot]: # Sourcery Code Quality Report


❌ &nbsp;Merging this PR will **decrease** code quality in the affected files by **0.32%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://docs.sourcery.ai/GitHub/Quality-Report/#complexity) | 5.44 ⭐ | 5.42 ⭐ | -0.02 👍 |
| [Method Length](https://docs.sourcery.ai/GitHub/Quality-Report/#method-length) | 94.36 🙂 | 95.54 🙂 | 1.18 👎 |
| [Working memory](https://docs.sourcery.ai/GitHub/Quality-Report/#working-memory) | 9.54 🙂 | 9.83 🙂 | 0.29 👎 |
| **[Quality](https://docs.sourcery.ai/GitHub/Quality-Report/#quality-score)** | **64.39%** 🙂| **64.07%** 🙂| **-0.32%** 👎 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 2216 | 2193 | -23 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 41.04% 😞 | 42.20% 😞 | 1.16% 👍|
| src/darker/command_line.py | 71.23% 🙂 | 70.55% 🙂 | -0.68% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 69.75% 🙂 | 69.74% 🙂 | -0.01% 👎|
| src/darker/tests/test_main.py | 67.85% 🙂 | 67.85% 🙂 | 0.00% |
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 😞 | 426 ⛔ | 17 ⛔ | 15.96% ⛔ | 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 | \_blacken\_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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | 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](https://docs.sourcery.ai/GitHub/Quality-Report/) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=8f5e2b2f2486ed660ca908f0c5fd742b36e8ebc4&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


❌ &nbsp;Merging this PR will **decrease** code quality in the affected files by **0.27%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://docs.sourcery.ai/GitHub/Quality-Report/#complexity) | 5.44 ⭐ | 5.40 ⭐ | -0.04 👍 |
| [Method Length](https://docs.sourcery.ai/GitHub/Quality-Report/#method-length) | 94.36 🙂 | 95.54 🙂 | 1.18 👎 |
| [Working memory](https://docs.sourcery.ai/GitHub/Quality-Report/#working-memory) | 9.54 🙂 | 9.81 🙂 | 0.27 👎 |
| **[Quality](https://docs.sourcery.ai/GitHub/Quality-Report/#quality-score)** | **64.39%** 🙂| **64.12%** 🙂| **-0.27%** 👎 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 2216 | 2194 | -22 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 41.04% 😞 | 42.43% 😞 | 1.39% 👍|
| src/darker/command_line.py | 71.23% 🙂 | 70.48% 🙂 | -0.75% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 69.75% 🙂 | 69.74% 🙂 | -0.01% 👎|
| src/darker/tests/test_main.py | 67.85% 🙂 | 67.85% 🙂 | 0.00% |
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 😞 | 426 ⛔ | 17 ⛔ | 15.96% ⛔ | 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 | \_blacken\_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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | 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](https://docs.sourcery.ai/GitHub/Quality-Report/) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=1468ec45c9729241a73971c506b65e3998cf6b44&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


❌ &nbsp;Merging this PR will **decrease** code quality in the affected files by **0.27%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://docs.sourcery.ai/GitHub/Quality-Report/#complexity) | 5.44 ⭐ | 5.40 ⭐ | -0.04 👍 |
| [Method Length](https://docs.sourcery.ai/GitHub/Quality-Report/#method-length) | 94.36 🙂 | 95.54 🙂 | 1.18 👎 |
| [Working memory](https://docs.sourcery.ai/GitHub/Quality-Report/#working-memory) | 9.54 🙂 | 9.81 🙂 | 0.27 👎 |
| **[Quality](https://docs.sourcery.ai/GitHub/Quality-Report/#quality-score)** | **64.39%** 🙂| **64.12%** 🙂| **-0.27%** 👎 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 2216 | 2194 | -22 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 41.04% 😞 | 42.43% 😞 | 1.39% 👍|
| src/darker/command_line.py | 71.23% 🙂 | 70.48% 🙂 | -0.75% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 69.75% 🙂 | 69.74% 🙂 | -0.01% 👎|
| src/darker/tests/test_main.py | 67.85% 🙂 | 67.85% 🙂 | 0.00% |
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 😞 | 426 ⛔ | 17 ⛔ | 15.96% ⛔ | 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 | \_blacken\_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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | 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](https://docs.sourcery.ai/GitHub/Quality-Report/) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=69b1b59295dd8e97a78e8dcd7f2c56d19319d5cd&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


❌ &nbsp;Merging this PR will **decrease** code quality in the affected files by **0.27%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://docs.sourcery.ai/GitHub/Quality-Report/#complexity) | 5.44 ⭐ | 5.40 ⭐ | -0.04 👍 |
| [Method Length](https://docs.sourcery.ai/GitHub/Quality-Report/#method-length) | 94.36 🙂 | 95.54 🙂 | 1.18 👎 |
| [Working memory](https://docs.sourcery.ai/GitHub/Quality-Report/#working-memory) | 9.54 🙂 | 9.81 🙂 | 0.27 👎 |
| **[Quality](https://docs.sourcery.ai/GitHub/Quality-Report/#quality-score)** | **64.39%** 🙂| **64.12%** 🙂| **-0.27%** 👎 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 2216 | 2194 | -22 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 41.04% 😞 | 42.43% 😞 | 1.39% 👍|
| src/darker/command_line.py | 71.23% 🙂 | 70.48% 🙂 | -0.75% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 69.75% 🙂 | 69.74% 🙂 | -0.01% 👎|
| src/darker/tests/test_main.py | 67.85% 🙂 | 67.85% 🙂 | 0.00% |
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 😞 | 426 ⛔ | 17 ⛔ | 15.96% ⛔ | 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 | \_blacken\_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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | 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](https://docs.sourcery.ai/GitHub/Quality-Report/) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=5e4523ba6d787a06092e63e573ecde14abe3cf68&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


❌ &nbsp;Merging this PR will **decrease** code quality in the affected files by **0.27%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://docs.sourcery.ai/GitHub/Quality-Report/#complexity) | 5.44 ⭐ | 5.40 ⭐ | -0.04 👍 |
| [Method Length](https://docs.sourcery.ai/GitHub/Quality-Report/#method-length) | 94.36 🙂 | 95.54 🙂 | 1.18 👎 |
| [Working memory](https://docs.sourcery.ai/GitHub/Quality-Report/#working-memory) | 9.54 🙂 | 9.81 🙂 | 0.27 👎 |
| **[Quality](https://docs.sourcery.ai/GitHub/Quality-Report/#quality-score)** | **64.39%** 🙂| **64.12%** 🙂| **-0.27%** 👎 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 2216 | 2194 | -22 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 41.04% 😞 | 42.43% 😞 | 1.39% 👍|
| src/darker/command_line.py | 71.23% 🙂 | 70.48% 🙂 | -0.75% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 69.75% 🙂 | 69.74% 🙂 | -0.01% 👎|
| src/darker/tests/test_main.py | 67.85% 🙂 | 67.85% 🙂 | 0.00% |
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 😞 | 426 ⛔ | 17 ⛔ | 15.96% ⛔ | 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 | \_blacken\_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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | 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](https://docs.sourcery.ai/GitHub/Quality-Report/) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=fb3003d15dca12f70a26ec9e8cc890d4bb7850d8&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


❌ &nbsp;Merging this PR will **decrease** code quality in the affected files by **0.27%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://docs.sourcery.ai/GitHub/Quality-Report/#complexity) | 5.44 ⭐ | 5.40 ⭐ | -0.04 👍 |
| [Method Length](https://docs.sourcery.ai/GitHub/Quality-Report/#method-length) | 94.36 🙂 | 95.54 🙂 | 1.18 👎 |
| [Working memory](https://docs.sourcery.ai/GitHub/Quality-Report/#working-memory) | 9.54 🙂 | 9.81 🙂 | 0.27 👎 |
| **[Quality](https://docs.sourcery.ai/GitHub/Quality-Report/#quality-score)** | **64.39%** 🙂| **64.12%** 🙂| **-0.27%** 👎 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 2216 | 2194 | -22 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 41.04% 😞 | 42.43% 😞 | 1.39% 👍|
| src/darker/command_line.py | 71.23% 🙂 | 70.48% 🙂 | -0.75% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 69.75% 🙂 | 69.74% 🙂 | -0.01% 👎|
| src/darker/tests/test_main.py | 67.85% 🙂 | 67.85% 🙂 | 0.00% |
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 😞 | 426 ⛔ | 17 ⛔ | 15.96% ⛔ | 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 | \_blacken\_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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | 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](https://docs.sourcery.ai/GitHub/Quality-Report/) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=bad7ba829c4461c9673d1816727d4e54a41649cf&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


❌ &nbsp;Merging this PR will **decrease** code quality in the affected files by **0.26%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://docs.sourcery.ai/GitHub/Quality-Report/#complexity) | 5.44 ⭐ | 5.40 ⭐ | -0.04 👍 |
| [Method Length](https://docs.sourcery.ai/GitHub/Quality-Report/#method-length) | 94.38 🙂 | 95.54 🙂 | 1.16 👎 |
| [Working memory](https://docs.sourcery.ai/GitHub/Quality-Report/#working-memory) | 9.54 🙂 | 9.81 🙂 | 0.27 👎 |
| **[Quality](https://docs.sourcery.ai/GitHub/Quality-Report/#quality-score)** | **64.38%** 🙂| **64.12%** 🙂| **-0.26%** 👎 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 2216 | 2194 | -22 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 41.03% 😞 | 42.43% 😞 | 1.40% 👍|
| src/darker/command_line.py | 71.23% 🙂 | 70.48% 🙂 | -0.75% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 69.75% 🙂 | 69.74% 🙂 | -0.01% 👎|
| src/darker/tests/test_main.py | 67.85% 🙂 | 67.85% 🙂 | 0.00% |
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 😞 | 426 ⛔ | 17 ⛔ | 15.96% ⛔ | 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 | \_blacken\_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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | 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](https://docs.sourcery.ai/GitHub/Quality-Report/) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=0eac2922a3a28469b62b348771ff6545717470e8&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


❌ &nbsp;Merging this PR will **decrease** code quality in the affected files by **0.26%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://docs.sourcery.ai/GitHub/Quality-Report/#complexity) | 5.44 ⭐ | 5.40 ⭐ | -0.04 👍 |
| [Method Length](https://docs.sourcery.ai/GitHub/Quality-Report/#method-length) | 94.38 🙂 | 95.54 🙂 | 1.16 👎 |
| [Working memory](https://docs.sourcery.ai/GitHub/Quality-Report/#working-memory) | 9.54 🙂 | 9.81 🙂 | 0.27 👎 |
| **[Quality](https://docs.sourcery.ai/GitHub/Quality-Report/#quality-score)** | **64.38%** 🙂| **64.12%** 🙂| **-0.26%** 👎 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 2216 | 2194 | -22 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 41.03% 😞 | 42.43% 😞 | 1.40% 👍|
| src/darker/command_line.py | 71.23% 🙂 | 70.48% 🙂 | -0.75% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 69.75% 🙂 | 69.74% 🙂 | -0.01% 👎|
| src/darker/tests/test_main.py | 67.85% 🙂 | 67.85% 🙂 | 0.00% |
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 😞 | 426 ⛔ | 17 ⛔ | 15.96% ⛔ | 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 | \_blacken\_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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | 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](https://docs.sourcery.ai/GitHub/Quality-Report/) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=eb03b3866da099797f01488f8b89652b694f60dd&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


❌ &nbsp;Merging this PR will **decrease** code quality in the affected files by **0.26%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://docs.sourcery.ai/GitHub/Quality-Report/#complexity) | 5.44 ⭐ | 5.40 ⭐ | -0.04 👍 |
| [Method Length](https://docs.sourcery.ai/GitHub/Quality-Report/#method-length) | 94.38 🙂 | 95.54 🙂 | 1.16 👎 |
| [Working memory](https://docs.sourcery.ai/GitHub/Quality-Report/#working-memory) | 9.54 🙂 | 9.81 🙂 | 0.27 👎 |
| **[Quality](https://docs.sourcery.ai/GitHub/Quality-Report/#quality-score)** | **64.38%** 🙂| **64.12%** 🙂| **-0.26%** 👎 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 2216 | 2194 | -22 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 41.03% 😞 | 42.43% 😞 | 1.40% 👍|
| src/darker/command_line.py | 71.23% 🙂 | 70.48% 🙂 | -0.75% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 69.75% 🙂 | 69.74% 🙂 | -0.01% 👎|
| src/darker/tests/test_main.py | 67.85% 🙂 | 67.85% 🙂 | 0.00% |
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 😞 | 426 ⛔ | 17 ⛔ | 15.96% ⛔ | 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 | \_blacken\_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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | 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](https://docs.sourcery.ai/GitHub/Quality-Report/) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=7a24b44a5eb70b21869bcc0a53d6c2fefe0efb6b&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


❌ &nbsp;Merging this PR will **decrease** code quality in the affected files by **0.26%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://docs.sourcery.ai/GitHub/Quality-Report/#complexity) | 5.44 ⭐ | 5.40 ⭐ | -0.04 👍 |
| [Method Length](https://docs.sourcery.ai/GitHub/Quality-Report/#method-length) | 94.38 🙂 | 95.54 🙂 | 1.16 👎 |
| [Working memory](https://docs.sourcery.ai/GitHub/Quality-Report/#working-memory) | 9.54 🙂 | 9.81 🙂 | 0.27 👎 |
| **[Quality](https://docs.sourcery.ai/GitHub/Quality-Report/#quality-score)** | **64.38%** 🙂| **64.12%** 🙂| **-0.26%** 👎 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 2216 | 2194 | -22 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 41.03% 😞 | 42.43% 😞 | 1.40% 👍|
| src/darker/command_line.py | 71.23% 🙂 | 70.48% 🙂 | -0.75% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 69.75% 🙂 | 69.74% 🙂 | -0.01% 👎|
| src/darker/tests/test_main.py | 67.85% 🙂 | 67.85% 🙂 | 0.00% |
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 😞 | 426 ⛔ | 17 ⛔ | 15.96% ⛔ | 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 | \_blacken\_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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | 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](https://docs.sourcery.ai/GitHub/Quality-Report/) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=cab645270c2a5e69a382087633c4f36d11e9d876&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


❌ &nbsp;Merging this PR will **decrease** code quality in the affected files by **0.26%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://docs.sourcery.ai/GitHub/Quality-Report/#complexity) | 5.44 ⭐ | 5.40 ⭐ | -0.04 👍 |
| [Method Length](https://docs.sourcery.ai/GitHub/Quality-Report/#method-length) | 94.38 🙂 | 95.54 🙂 | 1.16 👎 |
| [Working memory](https://docs.sourcery.ai/GitHub/Quality-Report/#working-memory) | 9.54 🙂 | 9.81 🙂 | 0.27 👎 |
| **[Quality](https://docs.sourcery.ai/GitHub/Quality-Report/#quality-score)** | **64.38%** 🙂| **64.12%** 🙂| **-0.26%** 👎 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 2216 | 2194 | -22 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 41.03% 😞 | 42.43% 😞 | 1.40% 👍|
| src/darker/command_line.py | 71.23% 🙂 | 70.48% 🙂 | -0.75% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 69.75% 🙂 | 69.74% 🙂 | -0.01% 👎|
| src/darker/tests/test_main.py | 67.85% 🙂 | 67.85% 🙂 | 0.00% |
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 😞 | 426 ⛔ | 17 ⛔ | 15.96% ⛔ | 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 | \_blacken\_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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | 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](https://docs.sourcery.ai/GitHub/Quality-Report/) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=6a7d3c39f24168b7cfacda5d384caadf8b2a6bcd&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


❌ &nbsp;Merging this PR will **decrease** code quality in the affected files by **0.26%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://docs.sourcery.ai/GitHub/Quality-Report/#complexity) | 5.44 ⭐ | 5.40 ⭐ | -0.04 👍 |
| [Method Length](https://docs.sourcery.ai/GitHub/Quality-Report/#method-length) | 94.38 🙂 | 95.54 🙂 | 1.16 👎 |
| [Working memory](https://docs.sourcery.ai/GitHub/Quality-Report/#working-memory) | 9.54 🙂 | 9.81 🙂 | 0.27 👎 |
| **[Quality](https://docs.sourcery.ai/GitHub/Quality-Report/#quality-score)** | **64.38%** 🙂| **64.12%** 🙂| **-0.26%** 👎 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 2216 | 2194 | -22 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 41.03% 😞 | 42.43% 😞 | 1.40% 👍|
| src/darker/command_line.py | 71.23% 🙂 | 70.48% 🙂 | -0.75% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 69.75% 🙂 | 69.74% 🙂 | -0.01% 👎|
| src/darker/tests/test_main.py | 67.85% 🙂 | 67.85% 🙂 | 0.00% |
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 😞 | 426 ⛔ | 17 ⛔ | 15.96% ⛔ | 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 | \_blacken\_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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | 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](https://docs.sourcery.ai/GitHub/Quality-Report/) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=6850173541961125ddf8aef2b21a881901034ed7&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


❌ &nbsp;Merging this PR will **decrease** code quality in the affected files by **0.26%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://docs.sourcery.ai/GitHub/Quality-Report/#complexity) | 5.44 ⭐ | 5.40 ⭐ | -0.04 👍 |
| [Method Length](https://docs.sourcery.ai/GitHub/Quality-Report/#method-length) | 94.38 🙂 | 95.55 🙂 | 1.17 👎 |
| [Working memory](https://docs.sourcery.ai/GitHub/Quality-Report/#working-memory) | 9.54 🙂 | 9.81 🙂 | 0.27 👎 |
| **[Quality](https://docs.sourcery.ai/GitHub/Quality-Report/#quality-score)** | **64.38%** 🙂| **64.12%** 🙂| **-0.26%** 👎 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 2216 | 2194 | -22 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 41.03% 😞 | 42.42% 😞 | 1.39% 👍|
| src/darker/command_line.py | 71.23% 🙂 | 70.48% 🙂 | -0.75% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 69.75% 🙂 | 69.74% 🙂 | -0.01% 👎|
| src/darker/tests/test_main.py | 67.85% 🙂 | 67.85% 🙂 | 0.00% |
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 😞 | 427 ⛔ | 17 ⛔ | 15.95% ⛔ | 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 | \_blacken\_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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | 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](https://docs.sourcery.ai/GitHub/Quality-Report/) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=83284a2502be8e3b570e71c986ae18a4cf14d3fa&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
akaihola: @rogalski @overratedpro, I worked on this pull request a bit during the past couple of days. It's now again rebased on `master`, and I did some modifications and additions. I'm willing to include it in the next release (1.4.0) if you see no serious flaws in it and feel like it will be useful to you and perhaps other users.

My main changes in a nutshell:
- `--jobs=1` is the default
- `--jobs=1` runs synchronously (using a custom dummy executor)
- use processes instead of threads for jobs
sourcery-ai[bot]: # Sourcery Code Quality Report


❌ &nbsp;Merging this PR will **decrease** code quality in the affected files by **0.26%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://docs.sourcery.ai/GitHub/Quality-Report/#complexity) | 5.44 ⭐ | 5.40 ⭐ | -0.04 👍 |
| [Method Length](https://docs.sourcery.ai/GitHub/Quality-Report/#method-length) | 94.38 🙂 | 95.55 🙂 | 1.17 👎 |
| [Working memory](https://docs.sourcery.ai/GitHub/Quality-Report/#working-memory) | 9.54 🙂 | 9.81 🙂 | 0.27 👎 |
| **[Quality](https://docs.sourcery.ai/GitHub/Quality-Report/#quality-score)** | **64.38%** 🙂| **64.12%** 🙂| **-0.26%** 👎 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 2216 | 2194 | -22 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 41.03% 😞 | 42.42% 😞 | 1.39% 👍|
| src/darker/command_line.py | 71.23% 🙂 | 70.48% 🙂 | -0.75% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 69.75% 🙂 | 69.74% 🙂 | -0.01% 👎|
| src/darker/tests/test_main.py | 67.85% 🙂 | 67.85% 🙂 | 0.00% |
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 😞 | 427 ⛔ | 17 ⛔ | 15.95% ⛔ | 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 | \_blacken\_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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | 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](https://docs.sourcery.ai/GitHub/Quality-Report/) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=eaa7d961e9ffcb557a04ca2591d45836940cba4c&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report


❌ &nbsp;Merging this PR will **decrease** code quality in the affected files by **0.26%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://docs.sourcery.ai/GitHub/Quality-Report/#complexity) | 5.44 ⭐ | 5.40 ⭐ | -0.04 👍 |
| [Method Length](https://docs.sourcery.ai/GitHub/Quality-Report/#method-length) | 94.38 🙂 | 95.55 🙂 | 1.17 👎 |
| [Working memory](https://docs.sourcery.ai/GitHub/Quality-Report/#working-memory) | 9.54 🙂 | 9.81 🙂 | 0.27 👎 |
| **[Quality](https://docs.sourcery.ai/GitHub/Quality-Report/#quality-score)** | **64.38%** 🙂| **64.12%** 🙂| **-0.26%** 👎 |



| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 2216 | 2194 | -22 |



| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 41.03% 😞 | 42.42% 😞 | 1.39% 👍|
| src/darker/command_line.py | 71.23% 🙂 | 70.48% 🙂 | -0.75% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.55% ⭐ | 0.00% |
| src/darker/help.py | 76.09% ⭐ | 75.68% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 69.75% 🙂 | 69.74% 🙂 | -0.01% 👎|
| src/darker/tests/test_main.py | 67.85% 🙂 | 67.85% 🙂 | 0.00% |
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |



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 😞 | 427 ⛔ | 17 ⛔ | 15.95% ⛔ | 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 | \_blacken\_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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | 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](https://docs.sourcery.ai/GitHub/Quality-Report/) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=b628adb40f7783491de5a35fcc010e3a967864df&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
akaihola: @DylanYoung I remember you had performance issues back in #23. Some performance improvements have already been done, and this one adds the capability to process multiple files in parallel.

Would you be interested to test this approach and to review the pull request?
sourcery-ai[bot]: # Sourcery Code Quality Report

❌ &nbsp;Merging this PR will **decrease** code quality in the affected files by **0.27%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://docs.sourcery.ai/GitHub/Quality-Report/#complexity) | 5.45 ⭐ | 5.41 ⭐ | -0.04 👍 |
| [Method Length](https://docs.sourcery.ai/GitHub/Quality-Report/#method-length) | 93.91 🙂 | 95.07 🙂 | 1.16 👎 |
| [Working memory](https://docs.sourcery.ai/GitHub/Quality-Report/#working-memory) | 9.54 🙂 | 9.81 🙂 | 0.27 👎 |
| **[Quality](https://docs.sourcery.ai/GitHub/Quality-Report/#quality-score)** | **64.43%** 🙂| **64.16%** 🙂| **-0.27%** 👎 |

| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 2220 | 2198 | -22 |

| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| src/darker/__main__.py | 41.05% 😞 | 42.44% 😞 | 1.39% 👍|
| src/darker/command_line.py | 71.23% 🙂 | 70.48% 🙂 | -0.75% 👎|
| src/darker/config.py | 91.55% ⭐ | 91.56% ⭐ | 0.01% 👍|
| src/darker/help.py | 76.37% ⭐ | 75.96% ⭐ | -0.41% 👎|
| src/darker/tests/test_command_line.py | 69.75% 🙂 | 69.74% 🙂 | -0.01% 👎|
| src/darker/tests/test_main.py | 67.95% 🙂 | 67.95% 🙂 | 0.00% |
| src/darker/tests/test_main_revision.py | 50.48% 🙂 | 50.48% 🙂 | 0.00% |

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 😞 | 422.97 ⛔ | 17 ⛔ | 15.99% ⛔ | Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions |
| src/darker/tests/test_main.py | test\_main | 6 ⭐ | 433.96 ⛔ | 25 ⛔ | 30.26% 😞 | Try splitting into smaller methods. Extract out complex expressions |
| src/darker/__main__.py | \_blacken\_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_main_revision.py | test\_revision | 1 ⭐ | 295 ⛔ | 11 😞 | 50.48% 🙂 | 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](https://docs.sourcery.ai/GitHub/Quality-Report/) 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](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=rogalski&base_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&base_remote_ref=refs%2Fpull%2F179%2Fhead&base_ref=master&base_sha=3d14226b04e6e0afa42e6a190a952b6f856a4705&head_repo=https%3A%2F%2Fgithub.com%2Fakaihola%2Fdarker.git&head_ref=sourcery%2Fpull-179&base_pr_number=179&base_pr_state=open) this quality report!
akaihola: @overratedpro quite a bit has changed in this PR since your review. Would you have time to take another look?
akaihola: I'm moving this one to the [1.5.0 release](https://github.com/akaihola/darker/milestone/13). I extracted some of the CI changes into #303 which will go into [1.4.2](https://github.com/akaihola/darker/milestone/14).

Patch:
diff --git a/CHANGES.rst b/CHANGES.rst
index 07db0d8..2c59f90 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -5,6 +5,8 @@ These features will be included in the next release:
 
 Added
 -----
+- The ``--jobs`` option now specifies how many Darker jobs are used to process files in
+  parallel to complete reformatting/linting faster
 
 Fixed
 -----
diff --git a/README.rst b/README.rst
index fd6e897..6f63f63 100644
--- a/README.rst
+++ b/README.rst
@@ -300,6 +300,8 @@ The following `command line arguments`_ can also be used to modify the defaults:
        to override ``skip_magic_trailing_comma = true`` from a configuration file.
 -l LENGTH, --line-length LENGTH
        How many characters per line to allow [default: 88]
+-j JOBS, --jobs JOBS
+       How many parallel jobs to allow [default: 1]
 
 To change default values for these options for a given project,
 add a ``[tool.darker]`` section to ``pyproject.toml`` in the project's root directory.
@@ -348,6 +350,8 @@ other tools. For example, VSCode only expects the reformat diff, so
 
 *New in version 1.3.0:* The ``-d`` / ``--stdout`` command line option
 
+*New in version 1.4.0:* The ``-j`` / ``--jobs`` command line option
+
 .. _Black documentation about pyproject.toml: https://black.readthedocs.io/en/stable/pyproject_toml.html
 .. _isort documentation about config files: https://timothycrosley.github.io/isort/docs/configuration/config_files/
 .. _command line arguments: https://black.readthedocs.io/en/stable/installation_and_usage.html#command-line-options
diff --git a/mypy.ini b/mypy.ini
index 749f3bf..a801264 100644
--- a/mypy.ini
+++ b/mypy.ini
@@ -47,6 +47,9 @@ disallow_any_explicit = False
 [mypy-darker.command_line]
 disallow_any_explicit = False
 
+[mypy-darker.concurrency]
+disallow_any_explicit = False
+
 [mypy-darker.config]
 disallow_subclassing_any = False
 
diff --git a/src/darker/__main__.py b/src/darker/__main__.py
index 7c5711f..5f47d9c 100644
--- a/src/darker/__main__.py
+++ b/src/darker/__main__.py
@@ -1,5 +1,6 @@
 """Darker - apply black reformatting to only areas edited since the last commit"""
 
+import concurrent.futures
 import logging
 import sys
 import warnings
@@ -17,6 +18,7 @@ from darker.black_diff import (
 )
 from darker.chooser import choose_lines
 from darker.command_line import parse_command_line
+from darker.concurrency import get_executor
 from darker.config import OutputMode, dump_config
 from darker.diff import diff_and_get_opcodes, opcodes_to_chunks
 from darker.exceptions import DependencyError, MissingPackageError
@@ -40,6 +42,8 @@ from darker.verification import ASTVerifier, BinarySearch, NotEquivalentError
 
 logger = logging.getLogger(__name__)
 
+ProcessedDocument = Tuple[Path, TextDocument, TextDocument]
+
 
 def format_edited_parts(
     root: Path,
@@ -49,8 +53,9 @@ def format_edited_parts(
     enable_isort: bool,
     black_config: BlackConfig,
     report_unmodified: bool,
-) -> Generator[Tuple[Path, TextDocument, TextDocument], None, None]:
-    """Black (and optional isort) formatting for chunks with edits since the last commit
+    jobs: int = 1,
+) -> Generator[ProcessedDocument, None, None]:
+    """Black (and optional isort) formatting modified chunks in a set of files
 
     Files inside given directories and excluded by Black's configuration are not
     reformatted using Black, but their imports are still sorted. Also, linters will be
@@ -67,45 +72,83 @@ def format_edited_parts(
     :param enable_isort: ``True`` to also run ``isort`` first on each changed file
     :param black_config: Configuration to use for running Black
     :param report_unmodified: ``True`` to yield also files which weren't modified
+    :param jobs: number of cpu processes to use (0 - autodetect)
     :return: A generator which yields details about changes for each file which should
              be reformatted, and skips unchanged files.
 
     """
-    for path_in_repo in sorted(changed_files):
-        src = root / path_in_repo
-        rev2_content = git_get_content_at_revision(path_in_repo, revrange.rev2, root)
-
-        # 1. run isort
-        if enable_isort:
-            rev2_isorted = apply_isort(
-                rev2_content,
-                src,
-                black_config.get("config"),
-                black_config.get("line_length"),
-            )
-        else:
-            rev2_isorted = rev2_content
-        if path_in_repo not in black_exclude:
-            # 9. A re-formatted Python file which produces an identical AST was
-            #    created successfully - write an updated file or print the diff if
-            #    there were any changes to the original
-            content_after_reformatting = _reformat_single_file(
+    with get_executor(max_workers=jobs) as executor:
+        # pylint: disable=unsubscriptable-object
+        futures: List[concurrent.futures.Future[ProcessedDocument]] = []
+        for path_in_repo in sorted(changed_files):
+            future = executor.submit(
+                _isort_and_blacken_single_file,
                 root,
                 path_in_repo,
                 revrange,
-                rev2_content,
-                rev2_isorted,
-                enable_isort,
                 black_config,
+                enable_isort,
+                enable_black=path_in_repo not in black_exclude,
             )
-        else:
-            # File was excluded by Black configuration, don't reformat
-            content_after_reformatting = rev2_isorted
-        if report_unmodified or content_after_reformatting != rev2_content:
-            yield (src, rev2_content, content_after_reformatting)
+            futures.append(future)
 
+        for future in concurrent.futures.as_completed(futures):
+            src, rev2_content, content_after_reformatting = future.result()
+            if report_unmodified or content_after_reformatting != rev2_content:
+                yield (src, rev2_content, content_after_reformatting)
 
-def _reformat_single_file(  # pylint: disable=too-many-arguments,too-many-locals
+
+def _isort_and_blacken_single_file(  # pylint: disable=too-many-arguments
+    root: Path,
+    relative_path: Path,
+    revrange: RevisionRange,
+    black_config: BlackConfig,
+    enable_isort: bool,
+    enable_black: bool,
+) -> ProcessedDocument:
+    """Black and/or isort formatting for modified chunks in a single file
+
+    :param root: Root directory for the relative path
+    :param relative_path: Relative path to a Python source code file
+    :param revrange: The Git revisions to compare
+    :param black_config: Configuration to use for running Black
+    :param enable_isort: ``True`` to run ``isort`` first on the file contents
+    :param enable_black: ``True`` to also run ``black`` on the file contents
+    :return: Details about changes for the file
+
+    """
+    src = root / relative_path
+    rev2_content = git_get_content_at_revision(relative_path, revrange.rev2, root)
+    # 1. run isort
+    if enable_isort:
+        rev2_isorted = apply_isort(
+            rev2_content,
+            src,
+            black_config.get("config"),
+            black_config.get("line_length"),
+        )
+    else:
+        rev2_isorted = rev2_content
+    if enable_black:
+        # 9. A re-formatted Python file which produces an identical AST was
+        #    created successfully - write an updated file or print the diff if
+        #    there were any changes to the original
+        content_after_reformatting = _blacken_single_file(
+            root,
+            relative_path,
+            revrange,
+            rev2_content,
+            rev2_isorted,
+            enable_isort,
+            black_config,
+        )
+    else:
+        # File was excluded by Black configuration, don't reformat
+        content_after_reformatting = rev2_isorted
+    return src, rev2_content, content_after_reformatting
+
+
+def _blacken_single_file(  # pylint: disable=too-many-arguments,too-many-locals
     root: Path,
     relative_path: Path,
     revrange: RevisionRange,
@@ -116,7 +159,7 @@ def _reformat_single_file(  # pylint: disable=too-many-arguments,too-many-locals
 ) -> TextDocument:
     """In a Python file, reformat chunks with edits since the last commit using Black
 
-    :param root: The common root of all files to reformat
+    :param root: Root directory for the relative path
     :param relative_path: Relative path to a Python source code file
     :param revrange: The Git revisions to compare
     :param rev2_content: Contents of the file at ``revrange.rev2``
@@ -383,14 +426,17 @@ def main(argv: List[str] = None) -> int:
         }
 
     formatting_failures_on_modified_lines = False
-    for path, old, new in format_edited_parts(
-        root,
-        changed_files_to_process,
-        black_exclude,
-        revrange,
-        args.isort,
-        black_config,
-        report_unmodified=output_mode == OutputMode.CONTENT,
+    for path, old, new in sorted(
+        format_edited_parts(
+            root,
+            changed_files_to_process,
+            black_exclude,
+            revrange,
+            args.isort,
+            black_config,
+            report_unmodified=output_mode == OutputMode.CONTENT,
+            jobs=config["jobs"],
+        ),
     ):
         formatting_failures_on_modified_lines = True
         if output_mode == OutputMode.DIFF:
diff --git a/src/darker/command_line.py b/src/darker/command_line.py
index bffb3f7..bef970b 100644
--- a/src/darker/command_line.py
+++ b/src/darker/command_line.py
@@ -82,6 +82,7 @@ def make_argument_parser(require_src: bool) -> ArgumentParser:
         dest="line_length",
         metavar="LENGTH",
     )
+    add_arg(hlp.JOBS, "-j", "--jobs", type=int, dest="jobs", default=1)
     # A hidden option for printing command lines option in a format suitable for
     # `README.rst`:
     add_arg(SUPPRESS, "--options-for-readme", action=OptionsForReadmeAction)
diff --git a/src/darker/concurrency.py b/src/darker/concurrency.py
new file mode 100644
index 0000000..bf26ca7
--- /dev/null
+++ b/src/darker/concurrency.py
@@ -0,0 +1,70 @@
+"""Concurrency helpers for enhancing the performance of Darker"""
+
+import sys
+from concurrent.futures import Executor, Future, ProcessPoolExecutor
+from typing import Any, Callable, Generic, TypeVar, cast
+
+T = TypeVar("T")  # pylint: disable=invalid-name
+
+if sys.version_info < (3, 9):
+
+    class FutureType(Generic[T]):
+        """For Python <3.9 compatibility"""
+
+        def set_exception(self, exc_info: BaseException) -> None:
+            "Dummy method for typing"
+
+        def set_result(self, result: Any) -> None:
+            "Dummy method for typing"
+
+else:
+    FutureType = Future
+
+
+class DummyExecutor(Executor):
+    """Dummy synchronous executor to use with ``--jobs=1``
+
+    This makes it easier to write test cases for `darker.__main__.main`.
+
+    """
+
+    # pylint: disable=arguments-differ,unsubscriptable-object,broad-except
+    def submit(  # type: ignore[override]
+        self, fn: Callable[..., T], *args: Any, **kwargs: Any
+    ) -> FutureType[T]:
+        """Submits "a callable to be executed with the given arguments.
+
+        Executes the callable immediately as ``fn(*args, **kwargs)`` and returns a
+        `Future` instance representing the execution of the callable.
+
+        :param fn: The callable to call
+        :param args: Positional arguments for the callable
+        :param kwargs: Keyword arguments for the callable
+        :return: A `Future` representing the given call
+
+        """
+        future = cast(FutureType[T], Future())
+        try:
+            result = fn(*args, **kwargs)
+        except BaseException as exc_info:
+            future.set_exception(exc_info)
+        else:
+            future.set_result(result)
+        return future
+
+
+def get_executor(max_workers: int) -> Executor:
+    """Return either a dummy executor (if ``max_workers===1`) or a process pool executor
+
+    :param max_workers: The maximum number of processes that can be used to execute the
+                        given calls. If ``0`` then as many worker processes will be
+                        created as the machine has processors. If ``1``, the dummy
+                        executor will be used so calls are executed synchronously.
+    :return: A dummy executor or a process pool executor
+
+    """
+    return (
+        DummyExecutor()
+        if max_workers == 1
+        else ProcessPoolExecutor(max_workers or None)
+    )
diff --git a/src/darker/config.py b/src/darker/config.py
index 5f05dbe..1ca1dc5 100644
--- a/src/darker/config.py
+++ b/src/darker/config.py
@@ -39,6 +39,7 @@ class DarkerConfig(TypedDict, total=False):
     skip_string_normalization: bool
     skip_magic_trailing_comma: bool
     line_length: int
+    jobs: int
 
 
 class OutputMode:
diff --git a/src/darker/help.py b/src/darker/help.py
index ee36291..3a51a7d 100644
--- a/src/darker/help.py
+++ b/src/darker/help.py
@@ -76,3 +76,5 @@ SKIP_MAGIC_TRAILING_COMMA = (
 )
 
 LINE_LENGTH = "How many characters per line to allow [default: 88]"
+
+JOBS = "How many parallel jobs to allow, or `0` for one per core [default: 1]"


Test patch:
diff --git a/src/darker/tests/test_command_line.py b/src/darker/tests/test_command_line.py
index b5fae45..c737438 100644
--- a/src/darker/tests/test_command_line.py
+++ b/src/darker/tests/test_command_line.py
@@ -589,7 +589,9 @@ def test_options(git_repo, options, expect):
         retval = main(options)
 
     expect = (Path(git_repo.root), expect[1]) + expect[2:]
-    format_edited_parts.assert_called_once_with(*expect, report_unmodified=False)
+    format_edited_parts.assert_called_once_with(
+        *expect, report_unmodified=False, jobs=1
+    )
     assert retval == 0
 
 
diff --git a/src/darker/tests/test_concurrency.py b/src/darker/tests/test_concurrency.py
new file mode 100644
index 0000000..bee69e3
--- /dev/null
+++ b/src/darker/tests/test_concurrency.py
@@ -0,0 +1,46 @@
+"""Tests for `darker.concurrency`"""
+
+from concurrent.futures import Future, ProcessPoolExecutor
+from unittest.mock import Mock
+
+import pytest
+
+from darker import concurrency
+
+
+def test_dummy_executor_submit_success():
+    """Function is executed synchronously and future gives the return value"""
+    executor = concurrency.DummyExecutor()
+    func = Mock(return_value=42)
+
+    future = executor.submit(func, "arg", kwarg="kwarg")
+
+    assert isinstance(future, Future)
+    assert future.result() == 42
+    func.assert_called_once_with("arg", kwarg="kwarg")
+
+
+def test_dummy_executor_submit_exception():
+    """Future raises the exception from the function"""
+    executor = concurrency.DummyExecutor()
+    func = Mock(side_effect=ValueError("my-exception"))
+
+    future = executor.submit(func, "arg", kwarg="kwarg")
+
+    assert isinstance(future, Future)
+    with pytest.raises(ValueError) as exc:
+        assert future.result() == 42
+        assert str(exc.value) == "my-exception"
+
+
+@pytest.mark.kwparametrize(
+    dict(max_workers=0, expect=ProcessPoolExecutor),
+    dict(max_workers=1, expect=concurrency.DummyExecutor),
+    dict(max_workers=2, expect=ProcessPoolExecutor),
+    dict(max_workers=42, expect=ProcessPoolExecutor),
+)
+def test_get_executor(max_workers, expect):
+    """A correct executor object is returned based on ``max_workers``"""
+    result = concurrency.get_executor(max_workers)
+
+    assert isinstance(result, expect)
diff --git a/src/darker/tests/test_main.py b/src/darker/tests/test_main.py
index 018796b..b1bca07 100644
--- a/src/darker/tests/test_main.py
+++ b/src/darker/tests/test_main.py
@@ -373,7 +373,7 @@ def test_format_edited_parts_historical(git_repo, rev1, rev2, expect):
     black_config={},
     expect="import  original\nprint( original )\n",
 )
-def test_reformat_single_file(
+def test_blacken_single_file(
     git_repo,
     relative_path,
     rev1,
@@ -384,11 +384,11 @@ def test_reformat_single_file(
     black_config,
     expect,
 ):
-    """Test for ``_reformat_single_file``"""
+    """Test for ``_blacken_single_file``"""
     git_repo.add(
         {"file.py": "import  original\nprint( original )\n"}, commit="Initial commit"
     )
-    result = darker.__main__._reformat_single_file(
+    result = darker.__main__._blacken_single_file(
         git_repo.root,
         Path(relative_path),
         RevisionRange(rev1, rev2),
diff --git a/src/darker/tests/test_main_reformat_single_file.py b/src/darker/tests/test_main_blacken_single_file.py
similarity index 84%
rename from src/darker/tests/test_main_reformat_single_file.py
rename to src/darker/tests/test_main_blacken_single_file.py
index 665dec8..62dd37f 100644
--- a/src/darker/tests/test_main_reformat_single_file.py
+++ b/src/darker/tests/test_main_blacken_single_file.py
@@ -1,4 +1,4 @@
-"""Unit tests for :func:`darker.__main__._reformat_single_file`"""
+"""Unit tests for :func:`darker.__main__._blacken_single_file`"""
 
 # pylint: disable=protected-access
 
@@ -10,8 +10,8 @@ from darker.git import RevisionRange
 from darker.utils import TextDocument
 
 
-def test_reformat_single_file_common_ancestor(git_repo):
-    """``_reformat_single_file()`` compares to the common ancestor of ``rev1...rev2``"""
+def test_blacken_single_file_common_ancestor(git_repo):
+    """``_blacken_single_file()`` compares to the common ancestor of ``rev1...rev2``"""
     a_py_initial = dedent(
         """\
         a=1
@@ -55,7 +55,7 @@ def test_reformat_single_file_common_ancestor(git_repo):
     git_repo.add({"a.py": a_py_feature}, commit="on feature")
     worktree = TextDocument.from_str(a_py_worktree)
 
-    result = darker.__main__._reformat_single_file(
+    result = darker.__main__._blacken_single_file(
         git_repo.root,
         Path("a.py"),
         RevisionRange.parse_with_common_ancestor("master...", git_repo.root),
diff --git a/src/darker/tests/test_main_revision.py b/src/darker/tests/test_main_revision.py
index 6374551..4472236 100644
--- a/src/darker/tests/test_main_revision.py
+++ b/src/darker/tests/test_main_revision.py
@@ -43,63 +43,63 @@ from darker.tests.helpers import raises_if_exception
     dict(
         revision="",
         worktree_content=b"USERMOD=1\n",
-        expect=["+1", "+1M0", "+2-1", "+2", "+2M1-0", "+2M1"],
+        expect={"+1", "+1M0", "+2-1", "+2", "+2M1-0", "+2M1"},
     ),
     dict(
         revision="",
         worktree_content=b"ORIGINAL=1\n",
-        expect=["+1M0", "+2-1", "+2M1-0", "+2M1"],
+        expect={"+1M0", "+2-1", "+2M1-0", "+2M1"},
     ),
     dict(
         revision="",
         worktree_content=b"MODIFIED=1\n",
-        expect=["+1", "+2-1", "+2", "+2M1-0"],
+        expect={"+1", "+2-1", "+2", "+2M1-0"},
     ),
     dict(
         revision="HEAD",
         worktree_content=b"USERMOD=1\n",
-        expect=["+1", "+1M0", "+2-1", "+2", "+2M1-0", "+2M1"],
+        expect={"+1", "+1M0", "+2-1", "+2", "+2M1-0", "+2M1"},
     ),
     dict(
         revision="HEAD",
         worktree_content=b"ORIGINAL=1\n",
-        expect=["+1M0", "+2-1", "+2M1-0", "+2M1"],
+        expect={"+1M0", "+2-1", "+2M1-0", "+2M1"},
     ),
     dict(
         revision="HEAD",
         worktree_content=b"MODIFIED=1\n",
-        expect=["+1", "+2-1", "+2", "+2M1-0"],
+        expect={"+1", "+2-1", "+2", "+2M1-0"},
     ),
     dict(
         revision="HEAD^",
         worktree_content=b"USERMOD=1\n",
-        expect=["+1", "+1M0", "+2-1", "+2", "+2M1-0", "+2M1"],
+        expect={"+1", "+1M0", "+2-1", "+2", "+2M1-0", "+2M1"},
     ),
     dict(
         revision="HEAD^",
         worktree_content=b"USERMOD=1\n",
-        expect=["+1", "+1M0", "+2-1", "+2", "+2M1-0", "+2M1"],
+        expect={"+1", "+1M0", "+2-1", "+2", "+2M1-0", "+2M1"},
     ),
     dict(
         revision="HEAD^",
         worktree_content=b"ORIGINAL=1\n",
-        expect=["+2-1", "+2M1-0", "+2M1"],
+        expect={"+2-1", "+2M1-0", "+2M1"},
     ),
     dict(
         revision="HEAD^",
         worktree_content=b"MODIFIED=1\n",
-        expect=["+1", "+1M0", "+2-1", "+2"],
+        expect={"+1", "+1M0", "+2-1", "+2"},
     ),
     dict(
         revision="HEAD~2",
         worktree_content=b"USERMOD=1\n",
-        expect=["+1", "+1M0", "+2-1", "+2", "+2M1-0", "+2M1"],
+        expect={"+1", "+1M0", "+2-1", "+2", "+2M1-0", "+2M1"},
     ),
-    dict(revision="HEAD~2", worktree_content=b"ORIGINAL=1\n", expect=["+1", "+1M0"]),
+    dict(revision="HEAD~2", worktree_content=b"ORIGINAL=1\n", expect={"+1", "+1M0"}),
     dict(
         revision="HEAD~2",
         worktree_content=b"MODIFIED=1\n",
-        expect=["+1", "+1M0", "+2-1", "+2", "+2M1-0", "+2M1"],
+        expect={"+1", "+1M0", "+2-1", "+2", "+2M1-0", "+2M1"},
     ),
     dict(revision="HEAD~3", worktree_content=b"USERMOD=1\n", expect=SystemExit),
 )
@@ -141,9 +141,9 @@ def test_revision(git_repo, monkeypatch, capsys, revision, worktree_content, exp
     with raises_if_exception(expect):
         main(arguments)
 
-        modified_files = [
+        modified_files = {
             line.split("\t")[0][4:-3]
             for line in capsys.readouterr().out.splitlines()
             if line.startswith("+++ ")
-        ]
+        }
         assert modified_files == expect