-
Notifications
You must be signed in to change notification settings - Fork 24
Add new ruff lint rules #392
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
Changes from all commits
d1ece6e
f34b542
05616bf
3f098bd
62840cd
cd95ce1
570a128
1f5b93d
c8c0def
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,3 +17,6 @@ build-backend = "hatchling.build" | |
| exclude = [ | ||
| "tests", | ||
| ] | ||
|
|
||
| [tool.ruff] | ||
| src = ["src"] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,3 +16,6 @@ build-backend = "hatchling.build" | |
| exclude = [ | ||
| "tests", | ||
| ] | ||
|
|
||
| [tool.ruff] | ||
| src = ["src"] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,3 +19,6 @@ build-backend = "hatchling.build" | |
| exclude = [ | ||
| "tests", | ||
| ] | ||
|
|
||
| [tool.ruff] | ||
| src = ["src"] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -148,7 +148,6 @@ def read_before_execution( | |
| the `response`. If multiple `read_before_execution` methods throw exceptions, | ||
| the latest will be used and earlier ones will be logged and dropped. | ||
| """ | ||
| pass | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should these be raising NotImplementedError rather than just passing? Having the functions be no-ops seems odd.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They very specifically need to be no-ops. The usage is something like for interceptor in interceptors:
interceptor.read_before_execution(...)But not every implementation will implement all of these hooks. So if we had them throwing not implemented then we'd have to catch and ignore that, adding a bunch of useless thrashing
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this explicitly be
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Apparently this has already been a hotly debated topic that ruff has taken an opinionated stance on. It feels weird, but we can go with it if people feel strongly about it.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah iirc there are some that prefer |
||
|
|
||
| def modify_before_serialization( | ||
| self, context: InterceptorContext[Request, None, None, None] | ||
|
|
@@ -193,7 +192,6 @@ def read_before_serialization( | |
| If exceptions are thrown by this hook, execution will jump to | ||
| `modify_before_completion` with the thrown exception as the `response`. | ||
| """ | ||
| pass | ||
|
|
||
| def read_after_serialization( | ||
| self, context: InterceptorContext[Request, None, TransportRequest, None] | ||
|
|
@@ -214,7 +212,6 @@ def read_after_serialization( | |
| If exceptions are thrown by this hook, execution will jump to | ||
| `modify_before_completion` with the thrown exception as the `response`. | ||
| """ | ||
| pass | ||
|
|
||
| def modify_before_retry_loop( | ||
| self, context: InterceptorContext[Request, None, TransportRequest, None] | ||
|
|
@@ -259,7 +256,6 @@ def read_before_attempt( | |
| exception as the `response` If multiple `read_before_attempt` methods throw | ||
| exceptions, the latest will be used and earlier ones will be logged and dropped. | ||
| """ | ||
| pass | ||
|
|
||
| def modify_before_signing( | ||
| self, context: InterceptorContext[Request, None, TransportRequest, None] | ||
|
|
@@ -309,7 +305,6 @@ def read_before_signing( | |
| If exceptions are thrown by this hook, execution will jump to | ||
| `modify_before_attempt_completion` with the thrown exception as the `response`. | ||
| """ | ||
| pass | ||
|
|
||
| def read_after_signing( | ||
| self, context: InterceptorContext[Request, None, TransportRequest, None] | ||
|
|
@@ -333,7 +328,6 @@ def read_after_signing( | |
| If exceptions are thrown by this hook, execution will jump to | ||
| `modify_before_attempt_completion` with the thrown exception as the `response`. | ||
| """ | ||
| pass | ||
|
|
||
| def modify_before_transmit( | ||
| self, context: InterceptorContext[Request, None, TransportRequest, None] | ||
|
|
@@ -384,7 +378,6 @@ def read_before_transmit( | |
| If exceptions are thrown by this hook, execution will jump to | ||
| `modify_before_attempt_completion` with the thrown exception as the `response`. | ||
| """ | ||
| pass | ||
|
|
||
| def read_after_transmit( | ||
| self, | ||
|
|
@@ -411,7 +404,6 @@ def read_after_transmit( | |
| If exceptions are thrown by this hook, execution will jump to | ||
| `modify_before_attempt_completion` with the thrown exception as the `response`. | ||
| """ | ||
| pass | ||
|
|
||
| def modify_before_deserialization( | ||
| self, | ||
|
|
@@ -467,7 +459,6 @@ def read_before_deserialization( | |
| If exceptions are thrown by this hook, execution will jump to | ||
| `modify_before_attempt_completion` with the thrown exception as the `response`. | ||
| """ | ||
| pass | ||
|
|
||
| def read_after_deserialization( | ||
| self, | ||
|
|
@@ -495,7 +486,6 @@ def read_after_deserialization( | |
| If exceptions are thrown by this hook, execution will jump to | ||
| `modify_before_attempt_completion` with the thrown exception as the `response`. | ||
| """ | ||
| pass | ||
|
|
||
| def modify_before_attempt_completion( | ||
| self, | ||
|
|
@@ -554,7 +544,6 @@ def read_after_attempt( | |
| execution will then jump to `read_before_attempt`. Otherwise, execution will | ||
| jump to `modify_before_completion` with the thrown exception as the `response`. | ||
| """ | ||
| pass | ||
|
|
||
| def modify_before_completion( | ||
| self, | ||
|
|
@@ -605,4 +594,3 @@ def read_after_execution( | |
| final response. If multiple `read_after_execution` methods throw exceptions, | ||
| the latest will be used and earlier ones will be logged and dropped. | ||
| """ | ||
| pass | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,7 @@ | |
| from datetime import datetime | ||
| from email.utils import format_datetime, parsedate_to_datetime | ||
| from enum import Enum | ||
| from typing import Any, TypeAlias | ||
| from typing import Any | ||
|
|
||
| from .exceptions import ExpectationNotMetException | ||
| from .utils import ( | ||
|
|
@@ -16,7 +16,7 @@ | |
| serialize_rfc3339, | ||
| ) | ||
|
|
||
| Document: TypeAlias = ( | ||
| type Document = ( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I forgot this was still here - probably needs to be deleted (that can be done later) |
||
| Mapping[str, "Document"] | Sequence["Document"] | str | int | float | bool | None | ||
| ) | ||
|
|
||
|
|
||
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.
TIL