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

Make AbstractSpookEntityService and AbstractSpookEntityComponentService generic #729

Merged
merged 1 commit into from
Apr 23, 2024
Merged

Make AbstractSpookEntityService and AbstractSpookEntityComponentService generic #729

merged 1 commit into from
Apr 23, 2024

Conversation

cdce8p
Copy link
Contributor

@cdce8p cdce8p commented Apr 9, 2024

Description

SSIA

Motivation and Context

Improve typing and fix some issues.

How has this been tested?

--

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Comment on lines -21 to +25
async def async_handle_service(self, entity: InputNumber, _: ServiceCall) -> None:
async def async_handle_service(
self,
entity: InputNumber,
call: ServiceCall, # noqa: ARG002
) -> None:
Copy link
Contributor Author

@cdce8p cdce8p Apr 9, 2024

Choose a reason for hiding this comment

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

The argument names of overwritten methods should match the ones from the super class.
Mypy does not (yet?) validate this, but pyright does.

Parameter 3 name mismatch: base parameter is named "call", override parameter is named "_"

I believe ruff ARG002 is too strict in this case.

Update Found this old mypy issue: python/mypy#6709

Copy link

sonarcloud bot commented Apr 12, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Owner

@frenck frenck left a comment

Choose a reason for hiding this comment

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

Nice!

Thanks, @cdce8p 👍

../Frenck

@frenck frenck added the enhancement Enhancement of the code, not introducing new features. label Apr 23, 2024
@frenck frenck merged commit 52c9f8b into frenck:main Apr 23, 2024
6 of 7 checks passed
@cdce8p cdce8p deleted the generic-service branch April 23, 2024 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement of the code, not introducing new features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants