Skip to content

Commit f9c86da

Browse files
dmathieumwear
andauthored
Add code spell task, fix issues and run the task in CI (#1661)
* setup codespell * fix all codespell issues * add codespell github action --------- Co-authored-by: Matthew Wear <[email protected]>
1 parent d9324e0 commit f9c86da

File tree

37 files changed

+105
-35
lines changed

37 files changed

+105
-35
lines changed

.codespellignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ot
2+
te

.codespellrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# https://github.com/codespell-project/codespell
2+
[codespell]
3+
builtin = clear,rare,informal
4+
check-filenames =
5+
check-hidden =
6+
ignore-words = .codespellignore
7+
interactive = 1
8+
skip = .git,venv,coverage,doc,docs
9+
uri-ignore-words-list = *
10+
write =

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,3 +208,9 @@ jobs:
208208
with:
209209
gem: "${{ matrix.gem }}"
210210
ruby: "truffleruby"
211+
212+
codespell:
213+
runs-on: ubuntu-latest
214+
steps:
215+
- uses: actions/checkout@v4
216+
- run: make codespell

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,7 @@
2222
# rbenv configuration
2323
.ruby-version
2424

25+
# Python virtual env for codespell
26+
venv
27+
2528
tags

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ All notable changes to this project were documented in this file. This is of his
4646

4747
* [#286](https://github.com/open-telemetry/opentelemetry-ruby/pull/286) Update Schedule. ([@fbogsany](https://github.com/fbogsany))
4848

49-
* [#288](https://github.com/open-telemetry/opentelemetry-ruby/pull/288) Fix api/sdk gem install instuctions. ([@mwlang](https://github.com/mwlang))
49+
* [#288](https://github.com/open-telemetry/opentelemetry-ruby/pull/288) Fix api/sdk gem install instructions. ([@mwlang](https://github.com/mwlang))
5050

5151
* [#294](https://github.com/open-telemetry/opentelemetry-ruby/pull/294) Add CHANGELOG. ([@ericmustin](https://github.com/ericmustin))

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ to ensure that your code complies before opening a pull request.
154154
We also use Yard to generate class documentation automatically. Among other
155155
things, this means:
156156

157-
* Methods and arguments should include the appropraite type annotations
157+
* Methods and arguments should include the appropriate type annotations
158158
* You can use markdown formatting in your documentation comments
159159

160160
You can generate the docs locally to see the results, by running:

Makefile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Virtualized python tools via docker
2+
3+
# The directory where the virtual environment is created.
4+
VENVDIR := venv
5+
6+
PYTOOLS := $(VENVDIR)/bin
7+
8+
# The pip executable in the virtual environment.
9+
PIP := $(PYTOOLS)/pip
10+
11+
# The directory in the docker image where the current directory is mounted.
12+
WORKDIR := /workdir
13+
14+
# The python image to use for the virtual environment.
15+
PYTHONIMAGE := python:3.11.3-slim-bullseye
16+
17+
# Run the python image with the current directory mounted.
18+
DOCKERPY := docker run --rm -v "$(CURDIR):$(WORKDIR)" -w $(WORKDIR) $(PYTHONIMAGE)
19+
20+
# Create a virtual environment for Python tools.
21+
$(PYTOOLS):
22+
# The `--upgrade` flag is needed to ensure that the virtual environment is
23+
# created with the latest pip version.
24+
@$(DOCKERPY) bash -c "python3 -m venv $(VENVDIR) && $(PIP) install --upgrade pip"
25+
26+
# Install python packages into the virtual environment.
27+
$(PYTOOLS)/%: $(PYTOOLS)
28+
@$(DOCKERPY) $(PIP) install -r requirements.txt
29+
30+
CODESPELL = $(PYTOOLS)/codespell
31+
$(CODESPELL): PACKAGE=codespell
32+
33+
.PHONY: codespell
34+
codespell: $(CODESPELL)
35+
@$(DOCKERPY) $(CODESPELL)

api/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171

7272
* BREAKING CHANGE: Remove optional parent_context from in_span [729](https://github.com/open-telemetry/opentelemetry-ruby/pull/729)
7373
* BREAKING CHANGE: Refactor Baggage to remove Noop* [800](https://github.com/open-telemetry/opentelemetry-ruby/pull/800)
74-
- The noop baggage manger has been removed.
74+
- The noop baggage manager has been removed.
7575
- The baggage management methods are now available through OpenTelemetry::Baggage#method, previously OpenTelemetry.baggage#method
7676
* BREAKING CHANGE: Total order constraint on span.status= [805](https://github.com/open-telemetry/opentelemetry-ruby/pull/805)
7777
- The OpenTelemetry::Trace::Util::HttpToStatus module has been removed as it was incorrectly setting the span status to OK for codes codes in the range 100..399

api/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ OpenTelemetry provides a single set of APIs, libraries, agents, and collector se
1212

1313
The `opentelemetry-api` gem defines the core OpenTelemetry interfaces in the form of abstract classes and no-op implementations. That is, it defines interfaces and data types sufficient for a library or application to code against to produce telemetry data, but does not actually collect, analyze, or export the data.
1414

15-
To collect and analyze telemetry data, *applications* should also install a concrete implementation of the API, such as the `opentelemetry-sdk` gem. However, *libraries* that produce telemetry data should depend only on `opentelemetry-api`, deferring the choise of concrete implementation to the application developer.
15+
To collect and analyze telemetry data, *applications* should also
16+
install a concrete implementation of the API, such as the
17+
`opentelemetry-sdk` gem. However, *libraries* that produce telemetry
18+
data should depend only on `opentelemetry-api`, deferring the choice of concrete implementation to the application developer.
1619

1720
## How do I get started?
1821

api/lib/opentelemetry/baggage.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def raw_entries(context: Context.current)
7373
# @param [String] key The key to store this value under
7474
# @param [String] value String value to be stored under key
7575
# @param [optional String] metadata This is here to store properties
76-
# received from other W3C Baggage impelmentations but is not exposed in
76+
# received from other W3C Baggage implementations but is not exposed in
7777
# OpenTelemetry. This is condsidered private API and not for use by
7878
# end-users.
7979
# @param [optional Context] context The context to update with new

0 commit comments

Comments
 (0)