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

chore: resolve Ruff warnings A003, B023, D103 and PLR0911 #684

Merged
merged 17 commits into from Dec 14, 2023

Conversation

BalduinLandolt
Copy link
Collaborator

No description provided.

@BalduinLandolt BalduinLandolt self-assigned this Dec 14, 2023
@BalduinLandolt BalduinLandolt changed the title chore: resolve Ruff warnings A003, B023 chore: resolve Ruff warnings A003, B023, D103 and PLR0911 Dec 14, 2023
@BalduinLandolt BalduinLandolt marked this pull request as ready for review December 14, 2023 11:02
Copy link
Collaborator

@jnussbaum jnussbaum left a comment

Choose a reason for hiding this comment

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

Very good, appreciate this one, thank you :-)

src/dsp_tools/commands/excel2xml/excel2xml_lib.py Outdated Show resolved Hide resolved
test/unittests/commands/excel2xml/test_excel2xml_lib.py Outdated Show resolved Hide resolved
@BalduinLandolt BalduinLandolt enabled auto-merge (squash) December 14, 2023 12:51
@BalduinLandolt BalduinLandolt merged commit b0f598c into main Dec 14, 2023
9 checks passed
@BalduinLandolt BalduinLandolt deleted the wip/ruff-stuff branch December 14, 2023 13:07
@daschbot daschbot mentioned this pull request Dec 14, 2023
@@ -136,38 +137,43 @@ def find_date_in_string(string: str) -> Optional[str]:
# sanitize input, just in case that the method was called on an empty or N/A cell
if not check_notna(string):
return None
try:
return _find_date_in_string_throwing(string)
Copy link
Collaborator

@jnussbaum jnussbaum Dec 14, 2023

Choose a reason for hiding this comment

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

I don't particularly like this pattern. In fact, no one of the called functions should raise an error, they should just return None if they don't succeed. Then, we don't need a function with this strange name.
(I know that it was me who introduced the ValueErrors, but now I don't like them anymore)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I am with you on that, but I didn't want to make bigger changes in a simple linting PR. Feel free to adjust that in a separate PR and I will happily approve it :)

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

3 participants