-
Notifications
You must be signed in to change notification settings - Fork 27
Some typing fixes #581
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
Some typing fixes #581
Conversation
rsconnect/main.py
Outdated
| if not isinstance(ce.remote_server, RSConnectServer): | ||
| raise RSConnectException("This command requires a Posit Connect server.") |
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.
I used a pretty generic exception message here, but am willing to customize it for each command, if you think that would help.
For example, in this case, it could be:
"`rsconnect content describe` requires a Posit Connect server."
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
| @wraps(func) | ||
| def wrapper(*args: P.args, **kwargs: P.kwargs): | ||
| def failed(err: str): | ||
| def failed(err: str) -> Never: |
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.
The explicit Never return helps pyright recognize that the calls to failed() will never return.
mmarchetti
left a comment
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.
I'm OK with the more generic messages, but the specific ones would be a nice touch.
This PR makes some typing fixes, and also adds some runtime checks that
ce.remote_serveris aRSConnectServer.