Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support sphinx 4.3#62 (Sourcery refactored) #73

Closed

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Nov 10, 2021

Pull Request #72 refactored by Sourcery.

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

NOTE: As code is pushed to the original Pull Request, Sourcery will
re-run and update (force-push) this Pull Request with new refactorings as
necessary. If Sourcery finds no refactorings at any point, this Pull Request
will be closed automatically.

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 support_sphinx_4.3#62 branch, then run:

git fetch origin sourcery/support_sphinx_4.3#62
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot temporarily deployed to ci November 10, 2021 23:32 Inactive
@sourcery-ai sourcery-ai bot temporarily deployed to ci November 10, 2021 23:32 Inactive
Comment on lines -48 to +51
# account for changed signature in sphinx 4.3, see #62
if sphinx.version_info >= (4, 3):
from sphinx.addnodes import desc_sig_space
return [Text(value), desc_sig_space()]
else:
if sphinx.version_info < (4, 3):
return f"{value} "
from sphinx.addnodes import desc_sig_space
return [Text(value), desc_sig_space()]
Copy link
Author

Choose a reason for hiding this comment

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

Function PydanticDirectiveBase.get_signature_prefix refactored with the following changes:

This removes the following comments ( why? ):

# account for changed signature in sphinx 4.3, see #62

Comment on lines -18 to +24
if sphinx.version_info >= (4, 3):
from sphinx.addnodes import desc_sig_space
return (desc_sig_space,
[desc_sig_punctuation, "="],
desc_sig_space,
value)
else:
if sphinx.version_info < (4, 3):
return [desc_annotation, f" = {value}"]
from sphinx.addnodes import desc_sig_space
return (desc_sig_space,
[desc_sig_punctuation, "="],
desc_sig_space,
value)
Copy link
Author

Choose a reason for hiding this comment

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

Function desc_annotation_default_value refactored with the following changes:

Comment on lines -34 to +38
if sphinx.version_info >= (4, 3):
from sphinx.addnodes import desc_sig_space
return ([desc_sig_punctuation, ":"],
desc_sig_space,
[pending_xref, type_str])
else:
if sphinx.version_info < (4, 3):
return (": ", [pending_xref, type_str])
from sphinx.addnodes import desc_sig_space
return ([desc_sig_punctuation, ":"],
desc_sig_space,
[pending_xref, type_str])
Copy link
Author

Choose a reason for hiding this comment

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

Function desc_annotation_type_annotation refactored with the following changes:

@sourcery-ai sourcery-ai bot temporarily deployed to ci November 10, 2021 23:32 Inactive
@sourcery-ai sourcery-ai bot temporarily deployed to ci November 10, 2021 23:32 Inactive
@sourcery-ai
Copy link
Author

sourcery-ai bot commented Nov 10, 2021

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 0.82 ⭐ 0.69 ⭐ -0.13 👍
Method Length 37.40 ⭐ 37.40 ⭐ 0.00
Working memory 5.95 ⭐ 5.82 ⭐ -0.13 👍
Quality 85.52% 85.98% 0.46% 👍
Other metrics Before After Change
Lines 139 137 -2
Changed files Quality Before Quality After Quality Change
sphinxcontrib/autodoc_pydantic/directives/directives.py 85.52% ⭐ 85.98% ⭐ 0.46% 👍

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!

@mansenfranzen mansenfranzen deleted the sourcery/support_sphinx_4.3#62 branch November 12, 2021 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant