-
Notifications
You must be signed in to change notification settings - Fork 22
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
Sourcery refactored v1.0.x branch #41
Conversation
self._strings = list() | ||
self._strings = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function StringTable.__init__
refactored with the following changes:
- Replace list() with [] (
list-literal
)
self._sheets = list() | ||
self._sheets = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function Workbook.__init__
refactored with the following changes:
- Replace list() with [] (
list-literal
)
return list(v[0] for v in self._sheets) | ||
return [v[0] for v in self._sheets] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function Workbook.sheets
refactored with the following changes:
- Replace list(), dict() or set() with comprehension (
collection-builtin-to-comprehension
)
rels = dict() | ||
rels = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function Workbook._parse
refactored with the following changes:
- Replace dict() with {} (
dict-literal
)
if rels_fp is not None: | ||
self._rels = ET.parse(rels_fp).getroot() | ||
else: | ||
self._rels = None | ||
self._rels = ET.parse(rels_fp).getroot() if rels_fp is not None else None | ||
self._stringtable = stringtable | ||
self._data_offset = 0 | ||
self.dimension = None | ||
self.cols = list() | ||
self.rels = dict() | ||
self.hyperlinks = dict() | ||
self.cols = [] | ||
self.rels = {} | ||
self.hyperlinks = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function Worksheet.__init__
refactored with the following changes:
- Replace if statement with if expression (
assign-if-exp
) - Replace list() with [] (
list-literal
) - Replace dict() with {} (
dict-literal
)
Sourcery Code Quality Report✅ Merging this PR will increase code quality in the affected files by 0.11%.
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! |
Branch
v1.0.x
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
v1.0.x
branch, then run:Help us improve this pull request!