-
Notifications
You must be signed in to change notification settings - Fork 652
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
Adding ruff
rule A
#4232
base: main
Are you sure you want to change the base?
Adding ruff
rule A
#4232
Changes from 1 commit
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 |
---|---|---|
|
@@ -121,8 +121,8 @@ def _is_valid_value(value: object) -> bool: | |
parts = str(value).split(";") | ||
is_valid_value = _VALUE_PATTERN.fullmatch(parts[0]) is not None | ||
if len(parts) > 1: # one or more properties metadata | ||
for property in parts[1:]: | ||
if _PROPERT_PATTERN.fullmatch(property) is None: | ||
for properties in parts[1:]: | ||
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. Maybe 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.
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 would use |
||
if _PROPERT_PATTERN.fullmatch(properties) is None: | ||
is_valid_value = False | ||
break | ||
return is_valid_value | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -684,7 +684,7 @@ def start_span( | |
context = SpanContextShim(span.get_span_context()) | ||
return SpanShim(self, context, span) | ||
|
||
def inject(self, span_context, format: object, carrier: object): | ||
def inject(self, span_context, formats: object, carrier: object): | ||
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. Not sure we can rename function parameters because a linter rule does not like it :) 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. Yes, in this case, I think we can just ignore it. |
||
"""Injects ``span_context`` into ``carrier``. | ||
|
||
See base class for more details. | ||
|
@@ -703,7 +703,7 @@ def inject(self, span_context, format: object, carrier: object): | |
# TODO: Support Format.BINARY once it is supported in | ||
# opentelemetry-python. | ||
|
||
if format not in self._supported_formats: | ||
if formats not in self._supported_formats: | ||
raise UnsupportedFormatException | ||
|
||
propagator = get_global_textmap() | ||
|
@@ -715,7 +715,7 @@ def inject(self, span_context, format: object, carrier: object): | |
ctx = set_span_in_context(span) | ||
propagator.inject(carrier, context=ctx) | ||
|
||
def extract(self, format: object, carrier: object): | ||
def extract(self, formats: object, carrier: object): | ||
"""Returns an ``opentracing.SpanContext`` instance extracted from a | ||
``carrier``. | ||
|
||
|
@@ -737,7 +737,7 @@ def extract(self, format: object, carrier: object): | |
# uses the configured propagators in opentelemetry.propagators. | ||
# TODO: Support Format.BINARY once it is supported in | ||
# opentelemetry-python. | ||
if format not in self._supported_formats: | ||
if formats not in self._supported_formats: | ||
raise UnsupportedFormatException | ||
|
||
propagator = get_global_textmap() | ||
|
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 am pretty sure we cannot change sphinx configuration for pleasing some lint rules 😅 see
https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-copyright
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.
Can ignore this too