Sourcery Starbot ⭐ refactored nanpuhaha/Power-BI-REST-API-Postman-Collection#3
Sourcery Starbot ⭐ refactored nanpuhaha/Power-BI-REST-API-Postman-Collection#3SourceryAI wants to merge 1 commit intonanpuhaha:masterfrom
Conversation
|
|
||
| uri_parameters_table = soup.select_one('#uri-parameters + table') | ||
| if uri_parameters_table: | ||
| if uri_parameters_table := soup.select_one('#uri-parameters + table'): |
There was a problem hiding this comment.
Function parse_page refactored with the following changes:
- Use named expression to simplify assignment and conditional [×3] (
use-named-expression) - Remove redundant pass statement (
remove-redundant-pass) - Remove unnecessary else after guard condition (
remove-unnecessary-else) - Replace f-string with no interpolated values with string [×2] (
remove-redundant-fstring) - Swap if/else branches of if expression to remove negation (
swap-if-expression) - Simplify boolean if expression (
boolean-if-exp-identity) - Remove unnecessary casts to int, str, float or bool (
remove-unnecessary-cast)
This removes the following comments ( why? ):
# query
| operations.append({ | ||
| 'name': name, | ||
| "request": { | ||
| "method": method, | ||
| "header": headers, | ||
| "body": body, | ||
| "url": { | ||
| "raw": url, | ||
| "protocol": parsed_url.scheme, # "https", | ||
| "host": parsed_url.netloc.split('.'), # ["api", "powerbi", "com"], | ||
| "path": paths, # ["v1.0", "myorg", "groups"], | ||
| "query": query | ||
| operations.append( | ||
| { | ||
| 'name': name, | ||
| "request": { | ||
| "method": method, | ||
| "header": headers, | ||
| "body": body, | ||
| "url": { | ||
| "raw": url, | ||
| "protocol": parsed_url.scheme, # "https", | ||
| "host": parsed_url.netloc.split( | ||
| '.' | ||
| ), # ["api", "powerbi", "com"], | ||
| "path": paths, # ["v1.0", "myorg", "groups"], | ||
| "query": query, | ||
| }, | ||
| "description": f'{description_title}<br>{description_html}', | ||
| }, | ||
| "description": description_title + '<br>' + description_html | ||
| }, | ||
| "response": [], | ||
| '_link': full_href | ||
| }) | ||
| "response": [], | ||
| '_link': full_href, | ||
| } | ||
| ) | ||
|
|
There was a problem hiding this comment.
Function main refactored with the following changes:
- Use f-string instead of string concatenation [×2] (
use-fstring-for-concatenation)
ContributorsCommit-Lint commandsYou can trigger Commit-Lint actions by commenting on this PR:
|
Sourcery Code Quality Report✅ Merging this PR will increase code quality in the affected files by 2.30%.
Here are some functions in these files that still need a tune-up:
Legend and ExplanationThe emojis denote the absolute quality of the code:
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! |
Thanks for starring sourcery-ai/sourcery ✨ 🌟 ✨
Here's your pull request refactoring your most popular Python repo.
If you want Sourcery to refactor all your Python repos and incoming pull requests install our bot.
Review changes via command line
To manually merge these changes, make sure you're on the
masterbranch, then run: