Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

Sourcery refactored master branch #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented May 12, 2022

Branch master refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the master branch, then run:

git fetch origin sourcery/master
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from shcheklein May 12, 2022 15:57
Comment on lines -67 to +70
name = "test-resource"
path = tmp_path / "terraform.tfstate"
path.parent.mkdir(parents=True, exist_ok=True)
path.write_text(TEST_RESOURCE_STATE, encoding="utf-8")
yield name
yield "test-resource"
Copy link
Author

Choose a reason for hiding this comment

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

Function resource refactored with the following changes:

resource = {
name: {key: value for key, value in config.items()},
}
resource = {name: dict(config.items())}
Copy link
Author

Choose a reason for hiding this comment

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

Function render_json refactored with the following changes:

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
resource = {
name: {key: value for key, value in config.items()},
}
resource = {name: dict(config.items())}
resource = {name: dict(config)}

parser = argparse.ArgumentParser(prog="tpi")
return parser
return argparse.ArgumentParser(prog="tpi")
Copy link
Author

Choose a reason for hiding this comment

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

Function get_main_parser refactored with the following changes:

@sourcery-ai
Copy link
Author

sourcery-ai bot commented May 12, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 0.67 ⭐ 0.68 ⭐ 0.01 👎
Method Length 41.80 ⭐ 41.25 ⭐ -0.55 👍
Working memory 6.52 🙂 6.37 🙂 -0.15 👍
Quality 83.81% 84.16% 0.35% 👍
Other metrics Before After Change
Lines 257 253 -4
Changed files Quality Before Quality After Quality Change
tests/test_terraform.py 84.40% ⭐ 84.51% ⭐ 0.11% 👍
tpi/init.py 80.40% ⭐ 81.36% ⭐ 0.96% 👍
tpi/main.py 96.69% ⭐ 97.50% ⭐ 0.81% 👍

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

File Function Complexity Length Working Memory Quality Recommendation

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant