Skip to content

Commit 18e056b

Browse files
authored
Codespell ci (#1237)
1 parent 934af7e commit 18e056b

File tree

30 files changed

+52
-36
lines changed

30 files changed

+52
-36
lines changed

.codespellrc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[codespell]
2+
# skipping auto generated folders
3+
skip = ./.tox,./.mypy_cache,./docs/_build,./target,*/LICENSE,./venv
4+
ignore-words-list = ot

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ jobs:
9595
strategy:
9696
fail-fast: false
9797
matrix:
98-
tox-environment: [ "docker-tests", "lint", "docs", "generate" ]
98+
tox-environment: [ "docker-tests", "spellcheck", "lint", "docs", "generate" ]
9999
name: ${{ matrix.tox-environment }}
100100
runs-on: ubuntu-20.04
101101
steps:

CHANGELOG.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
440440
([#567](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/567))
441441
- `opentelemetry-instrumentation-grpc` Respect the suppress instrumentation in gRPC client instrumentor
442442
([#559](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/559))
443-
- `opentelemetry-instrumentation-grpc` Fixed asynchonous unary call traces
443+
- `opentelemetry-instrumentation-grpc` Fixed asynchronous unary call traces
444444
([#536](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/536))
445445
- `opentelemetry-sdk-extension-aws` Update AWS entry points to match spec
446446
([#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
736736
([#182](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/182))
737737
- `opentelemetry-instrumentation-botocore` Botocore SpanKind as CLIENT and modify existing traced attributes
738738
([#150](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/150))
739-
- `opentelemetry-instrumentation-dbapi` Update dbapi and its dependant instrumentations to follow semantic conventions
739+
- `opentelemetry-instrumentation-dbapi` Update dbapi and its dependent instrumentations to follow semantic conventions
740740
([#195](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/195))
741741
- `opentelemetry-instrumentation-dbapi` Stop capturing query parameters by default
742742
([#156](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/156))

CONTRIBUTING.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ You can run:
4444
- `tox -e py37-test-flask` to e.g. run the Flask tests under a specific
4545
Python version
4646
- `tox -e lint` to run lint checks on all code
47+
- `tox -e spellcheck` to run spell check on the code
4748

4849
See
4950
[`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
172173

173174
* docstrings should adhere to the [Google Python Style
174175
Guide](http://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings)
175-
as specified with the [napolean
176+
as specified with the [napoleon
176177
extension](http://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html#google-vs-numpy)
177178
extension in [Sphinx](http://www.sphinx-doc.org/en/master/index.html).
178179

@@ -194,7 +195,7 @@ Below is a checklist of things to be mindful of when implementing a new instrume
194195
- https://github.com/open-telemetry/opentelemetry-python-contrib/issues/344 for more context
195196
- `exclude_urls` functionality
196197
- ex. https://github.com/open-telemetry/opentelemetry-python-contrib/blob/0fcb60d2ad139f78a52edd85b1cc4e32f2e962d0/instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py#L91
197-
- `url_filter` functonality
198+
- `url_filter` functionality
198199
- ex. https://github.com/open-telemetry/opentelemetry-python-contrib/blob/0fcb60d2ad139f78a52edd85b1cc4e32f2e962d0/instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/__init__.py#L235
199200
- `is_recording()` optimization on non-sampled spans
200201
- 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
204205

205206
## Expectations from contributors
206207

207-
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.
208+
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.
208209

dev-requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ grpcio-tools==1.29.0
1515
mypy-protobuf>=1.23
1616
protobuf~=3.13
1717
markupsafe==2.0.1
18+
codespell==2.1.0

exporter/opentelemetry-exporter-datadog/src/opentelemetry/exporter/datadog/exporter.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def _translate_to_datadog(self, spans):
127127

128128
# datadog Span is initialized with a reference to the tracer which is
129129
# used to record the span when it is finished. We can skip ignore this
130-
# because we are not calling the finish method and explictly set the
130+
# because we are not calling the finish method and explicitly set the
131131
# duration.
132132
tracer = None
133133

exporter/opentelemetry-exporter-datadog/src/opentelemetry/exporter/datadog/spanprocessor.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def worker(self):
127127
# missing spans will be sent when calling flush
128128
break
129129

130-
# substract the duration of this export call to the next timeout
130+
# subtract the duration of this export call to the next timeout
131131
start = time_ns()
132132
self.export()
133133
end = time_ns()

instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def strip_query_params(url: yarl.URL) -> str:
5959
Request/Response hooks
6060
**********************
6161
62-
Utilize request/reponse hooks to execute custom logic to be performed before/after performing a request.
62+
Utilize request/response hooks to execute custom logic to be performed before/after performing a request.
6363
6464
.. code-block:: python
6565

instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ async def hello():
7171
Request/Response hooks
7272
**********************
7373
74-
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
75-
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.
74+
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
75+
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.
7676
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.
7777
7878
.. code-block:: python
@@ -379,7 +379,7 @@ class OpenTelemetryMiddleware:
379379
server_request_hook: Optional callback which is called with the server span and ASGI
380380
scope object for every incoming request.
381381
client_request_hook: Optional callback which is called with the internal span and an ASGI
382-
scope which is sent as a dictionary for when the method recieve is called.
382+
scope which is sent as a dictionary for when the method receive is called.
383383
client_response_hook: Optional callback which is called with the internal span and an ASGI
384384
event which is sent as a dictionary for when the method send is called.
385385
tracer_provider: The optional tracer provider to use. If omitted

instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
"""
1616
The opentelemetry-instrumentation-aws-lambda package provides an `Instrumentor`
17-
to traces calls whithin a Python AWS Lambda function.
17+
to traces calls within a Python AWS Lambda function.
1818
1919
Usage
2020
-----

instrumentation/opentelemetry-instrumentation-boto/src/opentelemetry/instrumentation/boto/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def instrumentation_dependencies(self) -> Collection[str]:
8686
def _instrument(self, **kwargs):
8787
# AWSQueryConnection and AWSAuthConnection are two different classes
8888
# called by different services for connection.
89-
# For exemple EC2 uses AWSQueryConnection and S3 uses
89+
# For example EC2 uses AWSQueryConnection and S3 uses
9090
# AWSAuthConnection
9191

9292
# pylint: disable=attribute-defined-outside-init

instrumentation/opentelemetry-instrumentation-boto/tests/test_boto_instrumentation.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def test_s3_client(self):
147147
self.assertEqual(span.attributes["aws.operation"], "head_bucket")
148148
self.assertEqual(span.name, "s3.command")
149149

150-
# Checking for resource incase of error
150+
# Checking for resource in case of error
151151
try:
152152
s3.get_bucket("big_bucket")
153153
except Exception: # pylint: disable=broad-except

instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions/types.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class _AwsSdkCallContext:
3535
3636
Args:
3737
service: the AWS service (e.g. s3, lambda, ...) which is called
38-
service_id: the name of the service in propper casing
38+
service_id: the name of the service in proper casing
3939
operation: the called operation (e.g. ListBuckets, Invoke, ...) of the
4040
AWS service.
4141
params: a dict of input parameters passed to the service operation.

instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def _instrument(self, **kwargs):
266266
_DjangoMiddleware._active_request_counter = meter.create_up_down_counter(
267267
name="http.server.active_requests",
268268
unit="requests",
269-
description="measures the number of concurent HTTP requests those are currently in flight",
269+
description="measures the number of concurrent HTTP requests those are currently in flight",
270270
)
271271
# This can not be solved, but is an inherent problem of this approach:
272272
# the order of middleware entries matters, and here you have no control

instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ async def foobar():
5454
Request/Response hooks
5555
**********************
5656
57-
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
58-
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.
57+
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
58+
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.
5959
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.
6060
6161
.. code-block:: python

instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ def test_http_custom_response_headers_in_span_attributes(self):
490490

491491
def test_http_custom_response_headers_not_in_span_attributes(self):
492492
not_expected = {
493-
"http.reponse.header.custom_test_header_3": (
493+
"http.response.header.custom_test_header_3": (
494494
"test-header-value-3",
495495
),
496496
}
@@ -633,7 +633,7 @@ def test_web_socket_custom_response_headers_in_span_attributes(self):
633633

634634
def test_web_socket_custom_response_headers_not_in_span_attributes(self):
635635
not_expected = {
636-
"http.reponse.header.custom_test_header_3": (
636+
"http.response.header.custom_test_header_3": (
637637
"test-header-value-3",
638638
),
639639
}

instrumentation/opentelemetry-instrumentation-flask/README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ You can also pass the comma delimited regexes to the ``instrument_app`` method d
4141
Request/Response hooks
4242
**********************
4343

44-
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).
44+
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).
4545
Response_headers is a list of key-value (tuples) representing the response headers returned from the response.
4646

4747
.. code-block:: python

instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def hello():
6868
Request/Response hooks
6969
**********************
7070
71-
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).
71+
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).
7272
Response_headers is a list of key-value (tuples) representing the response headers returned from the response.
7373
7474
.. code-block:: python

instrumentation/opentelemetry-instrumentation-pymemcache/tests/utils.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ def __init__(self, connect_failure=None):
5656
self.sockets = []
5757

5858
def socket(self): # noqa: A002
59-
soket = MockSocket([], connect_failure=self.connect_failure)
60-
self.sockets.append(soket)
61-
return soket
59+
mock_socket = MockSocket([], connect_failure=self.connect_failure)
60+
self.sockets.append(mock_socket)
61+
return mock_socket
6262

6363
def __getattr__(self, name):
6464
return getattr(socket, name)

instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
---------------------------------
5656
5757
If you use Method 2 and then set tweens for your application with the ``pyramid.tweens`` setting,
58-
you need to add ``opentelemetry.instrumentation.pyramid.trace_tween_factory`` explicity to the list,
58+
you need to add ``opentelemetry.instrumentation.pyramid.trace_tween_factory`` explicitly to the list,
5959
*as well as* instrumenting the config as shown above.
6060
6161
For example:

instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def home(request):
5151
**********************
5252
5353
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
54-
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.
54+
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.
5555
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.
5656
5757
.. code-block:: python

instrumentation/opentelemetry-instrumentation-starlette/tests/test_starlette_instrumentation.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def test_starlette_route_attribute_added(self):
9595
)
9696

9797
def test_starlette_excluded_urls(self):
98-
"""Ensure that givem starlette routes are excluded."""
98+
"""Ensure that given starlette routes are excluded."""
9999
self._client.get("/healthzz")
100100
spans = self.memory_exporter.get_finished_spans()
101101
self.assertEqual(len(spans), 0)

instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ def _instrument(self, **kwargs):
221221
perfectly on the other hand as it executes in the same context as on_finish and log_exection which
222222
are patched to finish a span after a request is served.
223223
224-
However, we cannot just patch RequestHandler's prepare method because it is supposed to be overwridden
224+
However, we cannot just patch RequestHandler's prepare method because it is supposed to be overridden
225225
by sub-classes and since the parent prepare method does not do anything special, sub-classes don't
226226
have to call super() when overriding the method.
227227

instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def GET(self):
8585
Request/Response hooks
8686
**********************
8787
88-
Utilize request/reponse hooks to execute custom logic to be performed before/after performing a request. Environ is an instance of WSGIEnvironment.
88+
Utilize request/response hooks to execute custom logic to be performed before/after performing a request. Environ is an instance of WSGIEnvironment.
8989
Response_headers is a list of key-value (tuples) representing the response headers returned from the response.
9090
9191
.. code-block:: python

opentelemetry-instrumentation/README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ and when possible, apply automatic tracing instrumentation on them. This means y
5151
will get automatic distributed tracing for free without having to make any code changes
5252
at all. This will also configure a global tracer and tracing exporter without you having to
5353
make any code changes. By default, the instrument command will use the OTLP exporter but
54-
this can be overriden when needed.
54+
this can be overridden when needed.
5555

5656
The command supports the following configuration options as CLI arguments and environment vars:
5757

scripts/build_a_package.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
# This script builds wheels for a single package when trigged from a push to
17+
# This script builds wheels for a single package when triggered from a push to
1818
# a tag as part of a GitHub workflow (See .github/publish-a-package.yml). The
1919
# wheel is then published to PyPI.
2020

scripts/eachdist.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ def update_changelog(path, version, new_entry):
550550
text = changelog.read()
551551
if f"## [{version}]" in text:
552552
raise AttributeError(
553-
f"{path} already contans version {version}"
553+
f"{path} already contains version {version}"
554554
)
555555
with open(path, encoding="utf-8") as changelog:
556556
for line in changelog:

sdk-extension/opentelemetry-sdk-extension-aws/src/opentelemetry/sdk/extension/aws/resource/_lambda.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class AwsLambdaResourceDetector(ResourceDetector):
2929
"""Detects attribute values only available when the app is running on AWS
3030
Lambda and returns them in a Resource.
3131
32-
Uses Lambda defined runtime enivronment variables. See more: https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-runtime
32+
Uses Lambda defined runtime environment variables. See more: https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-runtime
3333
"""
3434

3535
def detect(self) -> "Resource":

tox.ini

+10
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ envlist =
200200
pypy3-test-instrumentation-kafka-python
201201

202202
lint
203+
spellcheck
203204
docker-tests
204205
docs
205206

@@ -426,6 +427,15 @@ changedir = docs
426427
commands =
427428
sphinx-build -E -a -W -b html -T . _build/html
428429

430+
[testenv:spellcheck]
431+
basepython: python3.9
432+
recreate = True
433+
deps =
434+
codespell
435+
436+
commands =
437+
codespell
438+
429439
[testenv:lint]
430440
basepython: python3.9
431441
recreate = False

util/opentelemetry-util-http/src/opentelemetry/util/http/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def remove_url_credentials(url: str) -> str:
124124
parsed_url.fragment,
125125
)
126126
)
127-
except ValueError: # an unparseable url was passed
127+
except ValueError: # an unparsable url was passed
128128
pass
129129
return url
130130

0 commit comments

Comments
 (0)