Skip to content
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

docs(typos): Run codespell to fix typos #3980

Merged
merged 8 commits into from
Apr 12, 2023

Conversation

CharlieTLe
Copy link
Contributor

@CharlieTLe CharlieTLe commented Apr 10, 2023

There were a lot of typos through the repository, so I ran codespell, a tool for automatically fixing typos, to fix them.

make codespell

There's already a tool called misspell that's supposed to take care of this, but misspell hasn't been updated for 6 years, and it doesn't seem to be catching any of the typos that codespell can.

To make this more automatic, perhaps we can set up a workflow to run codespell as well?

cc: @alolita

There were a lot of typos through the repository, so I ran
[codespell][], a tool for automatically fixing typos, to fix them.

```console
make codespell
```

There's already a tool called [misspell][] that's supposed to take care
of this, but misspell hasn't been updated for 6 years, and it doesn't
seem to be catching any of the typos that codespell can.

[codespell]: https://github.com/codespell-project/codespell
[misspell]: https://github.com/client9/misspell
@codecov
Copy link

codecov bot commented Apr 10, 2023

Codecov Report

Merging #3980 (7fa8fc2) into main (2b2817c) will increase coverage by 0.0%.
The diff coverage is 100.0%.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #3980   +/-   ##
=====================================
  Coverage   82.1%   82.1%           
=====================================
  Files        174     174           
  Lines      12975   12975           
=====================================
+ Hits       10653   10655    +2     
+ Misses      2102    2100    -2     
  Partials     220     220           
Impacted Files Coverage Δ
bridge/opencensus/internal/span.go 100.0% <ø> (ø)
bridge/opentracing/util.go 100.0% <ø> (ø)
...orters/otlp/otlpmetric/internal/otest/collector.go 6.9% <ø> (ø)
exporters/stdout/stdouttrace/trace.go 66.1% <ø> (ø)
sdk/metric/cache.go 100.0% <ø> (ø)
sdk/metric/instrument.go 96.0% <ø> (ø)
sdk/trace/batch_span_processor.go 81.9% <ø> (+0.8%) ⬆️
sdk/trace/span.go 87.9% <ø> (ø)
trace/noop.go 66.6% <ø> (ø)
...dk/metric/metricdata/metricdatatest/comparisons.go 88.2% <100.0%> (ø)

CHANGELOG.md Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
@dmathieu dmathieu added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Apr 11, 2023
Copy link
Member

@pellared pellared left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move the automation (Makefile and GitHub Actions) to a separate PR?

@CharlieTLe
Copy link
Contributor Author

Can we move the automation (Makefile and GitHub Actions) to a separate PR?

Yes, I'll remove it from this PR for now and file another PR afterwards. Thanks @pellared

Per @pellared, since there's no instructions for setting up codespell,
it was suggested that the changes for setting up a workflow and section
in Makefile include instructions for setting up codespell as well.
@CharlieTLe
Copy link
Contributor Author

Thanks for approving @pellared @dmathieu! Since I don't have write access, could someone help merge the PR?

@MrAlias MrAlias merged commit 1b55281 into open-telemetry:main Apr 12, 2023
CharlieTLe added a commit to CharlieTLe/opentelemetry-go that referenced this pull request Apr 13, 2023
This is a followup from
open-telemetry#3980 to add the
automation for checking for code spelling errors to a different PR.

[Codespell][] makes use of the `.codespellrc` file automatically as a config
file for convenience. The configuration file specifies directories and
flags to pass to `codespell`. Codespell also makes use of the
`.codespellignore` file to ignore certain word spellings.

There is a new section in `Makefile` for installing python tooling.
It is similar to how the go tools are installed. It sets up a virtualenv
in `venv `and installs python tooling there if it hasn't been installed
yet.

The new [codespell workflow][] will run in pull requests to annotate
misspelled words. It is set up to only warn the user with annotations in
the pull request if there are typos, but we can fail the pull request as
well if we want to by deleting the [warn_only][] key.

[codespell]: https://github.com/codespell-project/codespell
[codespell workflow]: https://github.com/codespell-project/actions-codespell
[warn_only]: https://github.com/codespell-project/actions-codespell#parameter-only_warn
MrAlias added a commit that referenced this pull request May 18, 2023
* feat(ci): Add codespell to Makefile and GitHub Actions

This is a followup from
#3980 to add the
automation for checking for code spelling errors to a different PR.

[Codespell][] makes use of the `.codespellrc` file automatically as a config
file for convenience. The configuration file specifies directories and
flags to pass to `codespell`. Codespell also makes use of the
`.codespellignore` file to ignore certain word spellings.

There is a new section in `Makefile` for installing python tooling.
It is similar to how the go tools are installed. It sets up a virtualenv
in `venv `and installs python tooling there if it hasn't been installed
yet.

The new [codespell workflow][] will run in pull requests to annotate
misspelled words. It is set up to only warn the user with annotations in
the pull request if there are typos, but we can fail the pull request as
well if we want to by deleting the [warn_only][] key.

[codespell]: https://github.com/codespell-project/codespell
[codespell workflow]: https://github.com/codespell-project/actions-codespell
[warn_only]: https://github.com/codespell-project/actions-codespell#parameter-only_warn

* Use docker to run python and codespell

Since this is a Go project, having a dependency on python seemed
disconcerting. So, docker is used to create a virtual environment
with a python image and also run the tools that were installed.

* Remove wording on requirement for python

* Apply suggestions from code review

Co-authored-by: Damien Mathieu <42@dmathieu.com>

* Pin versions into requirements.txt

* Pin version in requirements.txt

* Fix typo in license

* Revert typo fix on deleted file

* Update .github/workflows/codespell.yaml

Co-authored-by: Robert Pająk <pellared@hotmail.com>

* Update codespell.yaml

* Update codespell.yaml

---------

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Damien Mathieu <42@dmathieu.com>
Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
@XSAM XSAM added this to the Old Untracked PRs milestone Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants