From 18e056b85ae469fe6429cd45cbc1bc0db4cbc282 Mon Sep 17 00:00:00 2001 From: Gal Bashan Date: Mon, 29 Aug 2022 12:38:25 +0300 Subject: [PATCH] Codespell ci (#1237) --- .codespellrc | 4 ++++ .github/workflows/test.yml | 2 +- CHANGELOG.md | 4 ++-- CONTRIBUTING.md | 7 ++++--- dev-requirements.txt | 1 + .../src/opentelemetry/exporter/datadog/exporter.py | 2 +- .../opentelemetry/exporter/datadog/spanprocessor.py | 2 +- .../instrumentation/aiohttp_client/__init__.py | 2 +- .../src/opentelemetry/instrumentation/asgi/__init__.py | 6 +++--- .../instrumentation/aws_lambda/__init__.py | 2 +- .../src/opentelemetry/instrumentation/boto/__init__.py | 2 +- .../tests/test_boto_instrumentation.py | 2 +- .../instrumentation/botocore/extensions/types.py | 2 +- .../opentelemetry/instrumentation/django/__init__.py | 2 +- .../opentelemetry/instrumentation/fastapi/__init__.py | 4 ++-- .../tests/test_fastapi_instrumentation.py | 4 ++-- .../opentelemetry-instrumentation-flask/README.rst | 2 +- .../opentelemetry/instrumentation/flask/__init__.py | 2 +- .../tests/utils.py | 6 +++--- .../opentelemetry/instrumentation/pyramid/__init__.py | 2 +- .../instrumentation/starlette/__init__.py | 2 +- .../tests/test_starlette_instrumentation.py | 2 +- .../opentelemetry/instrumentation/tornado/__init__.py | 2 +- .../src/opentelemetry/instrumentation/wsgi/__init__.py | 2 +- opentelemetry-instrumentation/README.rst | 2 +- scripts/build_a_package.sh | 2 +- scripts/eachdist.py | 2 +- .../sdk/extension/aws/resource/_lambda.py | 2 +- tox.ini | 10 ++++++++++ .../src/opentelemetry/util/http/__init__.py | 2 +- 30 files changed, 52 insertions(+), 36 deletions(-) create mode 100644 .codespellrc diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000000..1e85aefda8 --- /dev/null +++ b/.codespellrc @@ -0,0 +1,4 @@ +[codespell] +# skipping auto generated folders +skip = ./.tox,./.mypy_cache,./docs/_build,./target,*/LICENSE,./venv +ignore-words-list = ot diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 30fe757cc6..6804222fd4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -95,7 +95,7 @@ jobs: strategy: fail-fast: false matrix: - tox-environment: [ "docker-tests", "lint", "docs", "generate" ] + tox-environment: [ "docker-tests", "spellcheck", "lint", "docs", "generate" ] name: ${{ matrix.tox-environment }} runs-on: ubuntu-20.04 steps: diff --git a/CHANGELOG.md b/CHANGELOG.md index e122d285e7..9a2b306157 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -440,7 +440,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#567](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/567)) - `opentelemetry-instrumentation-grpc` Respect the suppress instrumentation in gRPC client instrumentor ([#559](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/559)) -- `opentelemetry-instrumentation-grpc` Fixed asynchonous unary call traces +- `opentelemetry-instrumentation-grpc` Fixed asynchronous unary call traces ([#536](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/536)) - `opentelemetry-sdk-extension-aws` Update AWS entry points to match spec ([#566](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/566)) @@ -736,7 +736,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#182](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/182)) - `opentelemetry-instrumentation-botocore` Botocore SpanKind as CLIENT and modify existing traced attributes ([#150](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/150)) -- `opentelemetry-instrumentation-dbapi` Update dbapi and its dependant instrumentations to follow semantic conventions +- `opentelemetry-instrumentation-dbapi` Update dbapi and its dependent instrumentations to follow semantic conventions ([#195](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/195)) - `opentelemetry-instrumentation-dbapi` Stop capturing query parameters by default ([#156](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/156)) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ed1de3f001..038ee1ab0b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -44,6 +44,7 @@ You can run: - `tox -e py37-test-flask` to e.g. run the Flask tests under a specific Python version - `tox -e lint` to run lint checks on all code +- `tox -e spellcheck` to run spell check on the code See [`tox.ini`](https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/tox.ini) @@ -172,7 +173,7 @@ The continuation integration overrides that environment variable with as per the * docstrings should adhere to the [Google Python Style Guide](http://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings) - as specified with the [napolean + as specified with the [napoleon extension](http://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html#google-vs-numpy) extension in [Sphinx](http://www.sphinx-doc.org/en/master/index.html). @@ -194,7 +195,7 @@ Below is a checklist of things to be mindful of when implementing a new instrume - https://github.com/open-telemetry/opentelemetry-python-contrib/issues/344 for more context - `exclude_urls` functionality - ex. https://github.com/open-telemetry/opentelemetry-python-contrib/blob/0fcb60d2ad139f78a52edd85b1cc4e32f2e962d0/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py#L91 -- `url_filter` functonality +- `url_filter` functionality - ex. https://github.com/open-telemetry/opentelemetry-python-contrib/blob/0fcb60d2ad139f78a52edd85b1cc4e32f2e962d0/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/__init__.py#L235 - `is_recording()` optimization on non-sampled spans - ex. https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py#L133 @@ -204,5 +205,5 @@ Below is a checklist of things to be mindful of when implementing a new instrume ## Expectations from contributors -OpenTelemetry is an open source community, and as such, greatly encourages contributions from anyone interested in the project. With that being said, there is a certain level of expectation from contributors even after a pull request is merged, specifically pertaining to instrumentations. The OpenTelemetry Python community expects contributors to maintain a level of support and interest in the instrumentations they contribute. This is to ensure that the instrumentation does not become stale and still functions the way the original contributor intended. Some instrumentations also pertain to libraries that the current memebers of the community are not so familiar with, so it is necessary to rely on the expertise of the original contributing parties. +OpenTelemetry is an open source community, and as such, greatly encourages contributions from anyone interested in the project. With that being said, there is a certain level of expectation from contributors even after a pull request is merged, specifically pertaining to instrumentations. The OpenTelemetry Python community expects contributors to maintain a level of support and interest in the instrumentations they contribute. This is to ensure that the instrumentation does not become stale and still functions the way the original contributor intended. Some instrumentations also pertain to libraries that the current members of the community are not so familiar with, so it is necessary to rely on the expertise of the original contributing parties. diff --git a/dev-requirements.txt b/dev-requirements.txt index 9ad388090d..7938bda186 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -15,3 +15,4 @@ grpcio-tools==1.29.0 mypy-protobuf>=1.23 protobuf~=3.13 markupsafe==2.0.1 +codespell==2.1.0 diff --git a/exporter/opentelemetry-exporter-datadog/src/opentelemetry/exporter/datadog/exporter.py b/exporter/opentelemetry-exporter-datadog/src/opentelemetry/exporter/datadog/exporter.py index c530f86e63..2913885cb4 100644 --- a/exporter/opentelemetry-exporter-datadog/src/opentelemetry/exporter/datadog/exporter.py +++ b/exporter/opentelemetry-exporter-datadog/src/opentelemetry/exporter/datadog/exporter.py @@ -127,7 +127,7 @@ def _translate_to_datadog(self, spans): # datadog Span is initialized with a reference to the tracer which is # used to record the span when it is finished. We can skip ignore this - # because we are not calling the finish method and explictly set the + # because we are not calling the finish method and explicitly set the # duration. tracer = None diff --git a/exporter/opentelemetry-exporter-datadog/src/opentelemetry/exporter/datadog/spanprocessor.py b/exporter/opentelemetry-exporter-datadog/src/opentelemetry/exporter/datadog/spanprocessor.py index 4ac1abf4b1..f8f9b50079 100644 --- a/exporter/opentelemetry-exporter-datadog/src/opentelemetry/exporter/datadog/spanprocessor.py +++ b/exporter/opentelemetry-exporter-datadog/src/opentelemetry/exporter/datadog/spanprocessor.py @@ -127,7 +127,7 @@ def worker(self): # missing spans will be sent when calling flush break - # substract the duration of this export call to the next timeout + # subtract the duration of this export call to the next timeout start = time_ns() self.export() end = time_ns() diff --git a/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/__init__.py b/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/__init__.py index 8d0dc2f452..6323ad9bbe 100644 --- a/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/__init__.py @@ -59,7 +59,7 @@ def strip_query_params(url: yarl.URL) -> str: Request/Response hooks ********************** -Utilize request/reponse hooks to execute custom logic to be performed before/after performing a request. +Utilize request/response hooks to execute custom logic to be performed before/after performing a request. .. code-block:: python diff --git a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py index e3bbf16754..21e8a189b5 100644 --- a/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py @@ -71,8 +71,8 @@ async def hello(): Request/Response hooks ********************** -Utilize request/reponse hooks to execute custom logic to be performed before/after performing a request. The server request hook takes in a server span and ASGI -scope object for every incoming request. The client request hook is called with the internal span and an ASGI scope which is sent as a dictionary for when the method recieve is called. +Utilize request/response hooks to execute custom logic to be performed before/after performing a request. The server request hook takes in a server span and ASGI +scope object for every incoming request. The client request hook is called with the internal span and an ASGI scope which is sent as a dictionary for when the method receive is called. The client response hook is called with the internal span and an ASGI event which is sent as a dictionary for when the method send is called. .. code-block:: python @@ -379,7 +379,7 @@ class OpenTelemetryMiddleware: server_request_hook: Optional callback which is called with the server span and ASGI scope object for every incoming request. client_request_hook: Optional callback which is called with the internal span and an ASGI - scope which is sent as a dictionary for when the method recieve is called. + scope which is sent as a dictionary for when the method receive is called. client_response_hook: Optional callback which is called with the internal span and an ASGI event which is sent as a dictionary for when the method send is called. tracer_provider: The optional tracer provider to use. If omitted diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py b/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py index d791b2f17c..8467422fb9 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py @@ -14,7 +14,7 @@ """ The opentelemetry-instrumentation-aws-lambda package provides an `Instrumentor` -to traces calls whithin a Python AWS Lambda function. +to traces calls within a Python AWS Lambda function. Usage ----- diff --git a/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/__init__.py b/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/__init__.py index 757ff95f03..b94cc744b3 100644 --- a/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/__init__.py @@ -86,7 +86,7 @@ def instrumentation_dependencies(self) -> Collection[str]: def _instrument(self, **kwargs): # AWSQueryConnection and AWSAuthConnection are two different classes # called by different services for connection. - # For exemple EC2 uses AWSQueryConnection and S3 uses + # For example EC2 uses AWSQueryConnection and S3 uses # AWSAuthConnection # pylint: disable=attribute-defined-outside-init diff --git a/instrumentation/opentelemetry-instrumentation-boto/tests/test_boto_instrumentation.py b/instrumentation/opentelemetry-instrumentation-boto/tests/test_boto_instrumentation.py index 32347e5693..70965f991a 100644 --- a/instrumentation/opentelemetry-instrumentation-boto/tests/test_boto_instrumentation.py +++ b/instrumentation/opentelemetry-instrumentation-boto/tests/test_boto_instrumentation.py @@ -147,7 +147,7 @@ def test_s3_client(self): self.assertEqual(span.attributes["aws.operation"], "head_bucket") self.assertEqual(span.name, "s3.command") - # Checking for resource incase of error + # Checking for resource in case of error try: s3.get_bucket("big_bucket") except Exception: # pylint: disable=broad-except diff --git a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions/types.py b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions/types.py index 4e3130b5d1..b6a1c3aa57 100644 --- a/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions/types.py +++ b/instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions/types.py @@ -35,7 +35,7 @@ class _AwsSdkCallContext: Args: service: the AWS service (e.g. s3, lambda, ...) which is called - service_id: the name of the service in propper casing + service_id: the name of the service in proper casing operation: the called operation (e.g. ListBuckets, Invoke, ...) of the AWS service. params: a dict of input parameters passed to the service operation. diff --git a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/__init__.py b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/__init__.py index 3e5015abd6..680ff4e8f7 100644 --- a/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/__init__.py @@ -266,7 +266,7 @@ def _instrument(self, **kwargs): _DjangoMiddleware._active_request_counter = meter.create_up_down_counter( name="http.server.active_requests", unit="requests", - description="measures the number of concurent HTTP requests those are currently in flight", + description="measures the number of concurrent HTTP requests those are currently in flight", ) # This can not be solved, but is an inherent problem of this approach: # the order of middleware entries matters, and here you have no control diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/__init__.py b/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/__init__.py index 5cf17d36f0..1c76c8bb50 100644 --- a/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/__init__.py @@ -54,8 +54,8 @@ async def foobar(): Request/Response hooks ********************** -Utilize request/reponse hooks to execute custom logic to be performed before/after performing a request. The server request hook takes in a server span and ASGI -scope object for every incoming request. The client request hook is called with the internal span and an ASGI scope which is sent as a dictionary for when the method recieve is called. +Utilize request/response hooks to execute custom logic to be performed before/after performing a request. The server request hook takes in a server span and ASGI +scope object for every incoming request. The client request hook is called with the internal span and an ASGI scope which is sent as a dictionary for when the method receive is called. The client response hook is called with the internal span and an ASGI event which is sent as a dictionary for when the method send is called. .. code-block:: python diff --git a/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py b/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py index e4a0960a26..0d42e7533c 100644 --- a/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py +++ b/instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py @@ -490,7 +490,7 @@ def test_http_custom_response_headers_in_span_attributes(self): def test_http_custom_response_headers_not_in_span_attributes(self): not_expected = { - "http.reponse.header.custom_test_header_3": ( + "http.response.header.custom_test_header_3": ( "test-header-value-3", ), } @@ -633,7 +633,7 @@ def test_web_socket_custom_response_headers_in_span_attributes(self): def test_web_socket_custom_response_headers_not_in_span_attributes(self): not_expected = { - "http.reponse.header.custom_test_header_3": ( + "http.response.header.custom_test_header_3": ( "test-header-value-3", ), } diff --git a/instrumentation/opentelemetry-instrumentation-flask/README.rst b/instrumentation/opentelemetry-instrumentation-flask/README.rst index 4c775bc672..a708e7937a 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/README.rst +++ b/instrumentation/opentelemetry-instrumentation-flask/README.rst @@ -41,7 +41,7 @@ You can also pass the comma delimited regexes to the ``instrument_app`` method d Request/Response hooks ********************** -Utilize request/reponse hooks to execute custom logic to be performed before/after performing a request. Environ is an instance of WSGIEnvironment (flask.request.environ). +Utilize request/response hooks to execute custom logic to be performed before/after performing a request. Environ is an instance of WSGIEnvironment (flask.request.environ). Response_headers is a list of key-value (tuples) representing the response headers returned from the response. .. code-block:: python diff --git a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py index 77f227d15d..dcddbc40bf 100644 --- a/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py @@ -68,7 +68,7 @@ def hello(): Request/Response hooks ********************** -Utilize request/reponse hooks to execute custom logic to be performed before/after performing a request. Environ is an instance of WSGIEnvironment (flask.request.environ). +Utilize request/response hooks to execute custom logic to be performed before/after performing a request. Environ is an instance of WSGIEnvironment (flask.request.environ). Response_headers is a list of key-value (tuples) representing the response headers returned from the response. .. code-block:: python diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/tests/utils.py b/instrumentation/opentelemetry-instrumentation-pymemcache/tests/utils.py index 361fb6e68c..029a7d07a7 100644 --- a/instrumentation/opentelemetry-instrumentation-pymemcache/tests/utils.py +++ b/instrumentation/opentelemetry-instrumentation-pymemcache/tests/utils.py @@ -56,9 +56,9 @@ def __init__(self, connect_failure=None): self.sockets = [] def socket(self): # noqa: A002 - soket = MockSocket([], connect_failure=self.connect_failure) - self.sockets.append(soket) - return soket + mock_socket = MockSocket([], connect_failure=self.connect_failure) + self.sockets.append(mock_socket) + return mock_socket def __getattr__(self, name): return getattr(socket, name) diff --git a/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/__init__.py b/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/__init__.py index c225f2f11d..71db8a7426 100644 --- a/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/__init__.py @@ -55,7 +55,7 @@ --------------------------------- If you use Method 2 and then set tweens for your application with the ``pyramid.tweens`` setting, -you need to add ``opentelemetry.instrumentation.pyramid.trace_tween_factory`` explicity to the list, +you need to add ``opentelemetry.instrumentation.pyramid.trace_tween_factory`` explicitly to the list, *as well as* instrumenting the config as shown above. For example: diff --git a/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/__init__.py b/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/__init__.py index 259e054d32..110644cfb3 100644 --- a/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/__init__.py @@ -51,7 +51,7 @@ def home(request): ********************** Utilize request/response hooks to execute custom logic to be performed before/after performing a request. The server request hook takes in a server span and ASGI -scope object for every incoming request. The client request hook is called with the internal span and an ASGI scope which is sent as a dictionary for when the method recieve is called. +scope object for every incoming request. The client request hook is called with the internal span and an ASGI scope which is sent as a dictionary for when the method receive is called. The client response hook is called with the internal span and an ASGI event which is sent as a dictionary for when the method send is called. .. code-block:: python diff --git a/instrumentation/opentelemetry-instrumentation-starlette/tests/test_starlette_instrumentation.py b/instrumentation/opentelemetry-instrumentation-starlette/tests/test_starlette_instrumentation.py index 8c98feca4e..6f9a509450 100644 --- a/instrumentation/opentelemetry-instrumentation-starlette/tests/test_starlette_instrumentation.py +++ b/instrumentation/opentelemetry-instrumentation-starlette/tests/test_starlette_instrumentation.py @@ -95,7 +95,7 @@ def test_starlette_route_attribute_added(self): ) def test_starlette_excluded_urls(self): - """Ensure that givem starlette routes are excluded.""" + """Ensure that given starlette routes are excluded.""" self._client.get("/healthzz") spans = self.memory_exporter.get_finished_spans() self.assertEqual(len(spans), 0) diff --git a/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/__init__.py b/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/__init__.py index ed0122a7e8..59fc13944e 100644 --- a/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/__init__.py @@ -221,7 +221,7 @@ def _instrument(self, **kwargs): perfectly on the other hand as it executes in the same context as on_finish and log_exection which are patched to finish a span after a request is served. - However, we cannot just patch RequestHandler's prepare method because it is supposed to be overwridden + However, we cannot just patch RequestHandler's prepare method because it is supposed to be overridden by sub-classes and since the parent prepare method does not do anything special, sub-classes don't have to call super() when overriding the method. diff --git a/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py b/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py index 1d82b33037..70974b65a8 100644 --- a/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py @@ -85,7 +85,7 @@ def GET(self): Request/Response hooks ********************** -Utilize request/reponse hooks to execute custom logic to be performed before/after performing a request. Environ is an instance of WSGIEnvironment. +Utilize request/response hooks to execute custom logic to be performed before/after performing a request. Environ is an instance of WSGIEnvironment. Response_headers is a list of key-value (tuples) representing the response headers returned from the response. .. code-block:: python diff --git a/opentelemetry-instrumentation/README.rst b/opentelemetry-instrumentation/README.rst index 96e44a8496..a93bedcc27 100644 --- a/opentelemetry-instrumentation/README.rst +++ b/opentelemetry-instrumentation/README.rst @@ -51,7 +51,7 @@ and when possible, apply automatic tracing instrumentation on them. This means y will get automatic distributed tracing for free without having to make any code changes at all. This will also configure a global tracer and tracing exporter without you having to make any code changes. By default, the instrument command will use the OTLP exporter but -this can be overriden when needed. +this can be overridden when needed. The command supports the following configuration options as CLI arguments and environment vars: diff --git a/scripts/build_a_package.sh b/scripts/build_a_package.sh index 3920201191..1df97a26db 100755 --- a/scripts/build_a_package.sh +++ b/scripts/build_a_package.sh @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -# This script builds wheels for a single package when trigged from a push to +# This script builds wheels for a single package when triggered from a push to # a tag as part of a GitHub workflow (See .github/publish-a-package.yml). The # wheel is then published to PyPI. diff --git a/scripts/eachdist.py b/scripts/eachdist.py index f67ce405fe..103a63de88 100755 --- a/scripts/eachdist.py +++ b/scripts/eachdist.py @@ -550,7 +550,7 @@ def update_changelog(path, version, new_entry): text = changelog.read() if f"## [{version}]" in text: raise AttributeError( - f"{path} already contans version {version}" + f"{path} already contains version {version}" ) with open(path, encoding="utf-8") as changelog: for line in changelog: diff --git a/sdk-extension/opentelemetry-sdk-extension-aws/src/opentelemetry/sdk/extension/aws/resource/_lambda.py b/sdk-extension/opentelemetry-sdk-extension-aws/src/opentelemetry/sdk/extension/aws/resource/_lambda.py index 762725325c..6f8fe68048 100644 --- a/sdk-extension/opentelemetry-sdk-extension-aws/src/opentelemetry/sdk/extension/aws/resource/_lambda.py +++ b/sdk-extension/opentelemetry-sdk-extension-aws/src/opentelemetry/sdk/extension/aws/resource/_lambda.py @@ -29,7 +29,7 @@ class AwsLambdaResourceDetector(ResourceDetector): """Detects attribute values only available when the app is running on AWS Lambda and returns them in a Resource. - Uses Lambda defined runtime enivronment variables. See more: https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-runtime + Uses Lambda defined runtime environment variables. See more: https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-runtime """ def detect(self) -> "Resource": diff --git a/tox.ini b/tox.ini index 80fd488dce..a4cea4a49a 100644 --- a/tox.ini +++ b/tox.ini @@ -200,6 +200,7 @@ envlist = pypy3-test-instrumentation-kafka-python lint + spellcheck docker-tests docs @@ -426,6 +427,15 @@ changedir = docs commands = sphinx-build -E -a -W -b html -T . _build/html +[testenv:spellcheck] +basepython: python3.9 +recreate = True +deps = + codespell + +commands = + codespell + [testenv:lint] basepython: python3.9 recreate = False diff --git a/util/opentelemetry-util-http/src/opentelemetry/util/http/__init__.py b/util/opentelemetry-util-http/src/opentelemetry/util/http/__init__.py index 60eafdcd5b..9088da3a37 100644 --- a/util/opentelemetry-util-http/src/opentelemetry/util/http/__init__.py +++ b/util/opentelemetry-util-http/src/opentelemetry/util/http/__init__.py @@ -124,7 +124,7 @@ def remove_url_credentials(url: str) -> str: parsed_url.fragment, ) ) - except ValueError: # an unparseable url was passed + except ValueError: # an unparsable url was passed pass return url