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

Add codespell config (within pyproject.toml), action and fix the typos it finds (and fixes) #3098

Merged
merged 7 commits into from
Feb 1, 2024

Conversation

yarikoptic
Copy link
Contributor

No description provided.

@yarikoptic yarikoptic requested a review from a team as a code owner September 7, 2023 17:46
@yarikoptic yarikoptic force-pushed the enh-codespell branch 2 times, most recently from a9be623 to bebd8bc Compare September 7, 2023 17:49
@github-actions
Copy link

github-actions bot commented Sep 7, 2023

Merging this PR will trigger the following deployment actions.

Support and Staging deployments

Cloud Provider Cluster Name Upgrade Support? Reason for Support Redeploy Upgrade Staging? Reason for Staging Redeploy
gcp 2i2c-uk Yes Support helm chart has been modified Yes Core infrastructure has been modified
gcp linked-earth Yes Support helm chart has been modified Yes Core infrastructure has been modified
gcp callysto Yes Support helm chart has been modified Yes Core infrastructure has been modified
aws nasa-esdis Yes Support helm chart has been modified Yes Core infrastructure has been modified
aws gridsst Yes Support helm chart has been modified Yes Core infrastructure has been modified
gcp pangeo-hubs Yes Support helm chart has been modified Yes Core infrastructure has been modified
gcp 2i2c Yes Support helm chart has been modified Yes Core infrastructure has been modified
aws earthscope Yes Support helm chart has been modified Yes Core infrastructure has been modified
gcp qcl Yes Support helm chart has been modified Yes Core infrastructure has been modified
gcp awi-ciroh Yes Support helm chart has been modified Yes Core infrastructure has been modified
gcp hhmi Yes Support helm chart has been modified Yes Core infrastructure has been modified
aws nasa-veda Yes Support helm chart has been modified Yes Core infrastructure has been modified
gcp catalystproject-latam Yes Support helm chart has been modified Yes Core infrastructure has been modified
aws jupyter-meets-the-earth Yes Support helm chart has been modified Yes Core infrastructure has been modified
aws smithsonian Yes Support helm chart has been modified Yes Core infrastructure has been modified
aws nasa-ghg Yes Support helm chart has been modified Yes Core infrastructure has been modified
gcp meom-ige Yes Support helm chart has been modified Yes Core infrastructure has been modified
aws 2i2c-aws-us Yes Support helm chart has been modified Yes Core infrastructure has been modified
aws victor Yes Support helm chart has been modified Yes Core infrastructure has been modified
kubeconfig utoronto Yes Support helm chart has been modified Yes Core infrastructure has been modified
aws ubc-eoas Yes Support helm chart has been modified Yes Core infrastructure has been modified
aws catalystproject-africa Yes Support helm chart has been modified Yes Core infrastructure has been modified
aws openscapes Yes Support helm chart has been modified Yes Core infrastructure has been modified
gcp leap Yes Support helm chart has been modified Yes Core infrastructure has been modified
aws nasa-cryo Yes Support helm chart has been modified Yes Core infrastructure has been modified
gcp cloudbank Yes Support helm chart has been modified Yes Core infrastructure has been modified

Production deployments

Cloud Provider Cluster Name Hub Name Reason for Redeploy
gcp 2i2c-uk lis Core infrastructure has been modified
gcp linked-earth prod Core infrastructure has been modified
gcp callysto prod Core infrastructure has been modified
aws nasa-esdis prod Core infrastructure has been modified
aws gridsst prod Core infrastructure has been modified
gcp pangeo-hubs prod Core infrastructure has been modified
gcp pangeo-hubs coessing Core infrastructure has been modified
gcp 2i2c imagebuilding-demo Core infrastructure has been modified
gcp 2i2c demo Core infrastructure has been modified
gcp 2i2c ohw Core infrastructure has been modified
gcp 2i2c aup Core infrastructure has been modified
gcp 2i2c temple Core infrastructure has been modified
gcp 2i2c ucmerced Core infrastructure has been modified
gcp 2i2c climatematch Core infrastructure has been modified
gcp 2i2c mtu Core infrastructure has been modified
gcp 2i2c tufts Core infrastructure has been modified
aws earthscope prod Core infrastructure has been modified
gcp qcl prod Core infrastructure has been modified
gcp awi-ciroh prod Core infrastructure has been modified
gcp hhmi prod Core infrastructure has been modified
aws nasa-veda prod Core infrastructure has been modified
gcp catalystproject-latam unitefa-conicet Core infrastructure has been modified
aws jupyter-meets-the-earth prod Core infrastructure has been modified
aws smithsonian prod Core infrastructure has been modified
aws nasa-ghg prod Core infrastructure has been modified
gcp meom-ige prod Core infrastructure has been modified
aws 2i2c-aws-us showcase Core infrastructure has been modified
aws 2i2c-aws-us ncar-cisl Core infrastructure has been modified
aws 2i2c-aws-us go-bgc Core infrastructure has been modified
aws 2i2c-aws-us itcoocean Core infrastructure has been modified
aws 2i2c-aws-us cosmicds Core infrastructure has been modified
aws victor prod Core infrastructure has been modified
kubeconfig utoronto prod Core infrastructure has been modified
kubeconfig utoronto r-prod Core infrastructure has been modified
aws ubc-eoas prod Core infrastructure has been modified
aws catalystproject-africa nm-aist Core infrastructure has been modified
aws catalystproject-africa must Core infrastructure has been modified
aws openscapes prod Core infrastructure has been modified
gcp leap prod Core infrastructure has been modified
aws nasa-cryo prod Core infrastructure has been modified
gcp cloudbank bcc Core infrastructure has been modified
gcp cloudbank ccsf Core infrastructure has been modified
gcp cloudbank csm Core infrastructure has been modified
gcp cloudbank dvc Core infrastructure has been modified
gcp cloudbank elcamino Core infrastructure has been modified
gcp cloudbank evc Core infrastructure has been modified
gcp cloudbank glendale Core infrastructure has been modified
gcp cloudbank howard Core infrastructure has been modified
gcp cloudbank miracosta Core infrastructure has been modified
gcp cloudbank skyline Core infrastructure has been modified
gcp cloudbank demo Core infrastructure has been modified
gcp cloudbank fresno Core infrastructure has been modified
gcp cloudbank humboldt Core infrastructure has been modified
gcp cloudbank laney Core infrastructure has been modified
gcp cloudbank sbcc Core infrastructure has been modified
gcp cloudbank sbcc-dev Core infrastructure has been modified
gcp cloudbank elac Core infrastructure has been modified
gcp cloudbank lacc Core infrastructure has been modified
gcp cloudbank lamission Core infrastructure has been modified
gcp cloudbank mills Core infrastructure has been modified
gcp cloudbank mission Core infrastructure has been modified
gcp cloudbank norco Core infrastructure has been modified
gcp cloudbank palomar Core infrastructure has been modified
gcp cloudbank pasadena Core infrastructure has been modified
gcp cloudbank sjcc Core infrastructure has been modified
gcp cloudbank sacramento Core infrastructure has been modified
gcp cloudbank srjc Core infrastructure has been modified
gcp cloudbank saddleback Core infrastructure has been modified
gcp cloudbank santiago Core infrastructure has been modified
gcp cloudbank sjsu Core infrastructure has been modified
gcp cloudbank sierra Core infrastructure has been modified
gcp cloudbank tuskegee Core infrastructure has been modified
gcp cloudbank wlac Core infrastructure has been modified
gcp cloudbank csulb Core infrastructure has been modified
gcp cloudbank csum Core infrastructure has been modified

@yarikoptic
Copy link
Contributor Author

I have removed a dedicated github action since pre-commit.ci does the checks anyways. Note that pre-commit.ci does it also on .github/ files which seems to be ignored by default if you just run codespell locally.

@yarikoptic
Copy link
Contributor Author

yarikoptic commented Sep 22, 2023

before I resolve the conflicts -- please advise on either such PR would be reviewed/considered.

@sgibson91
Copy link
Member

Hi @yarikoptic! Thank you for this PR. I have opened an issue to prompt the engineering team to spend some time considering this and we can hopefully get back to you soon!

=== Do not change lines below ===
{
 "chain": [],
 "cmd": "codespell -w -i 3 -C 2",
 "exit": 0,
 "extra_inputs": [],
 "inputs": [],
 "outputs": [],
 "pwd": "."
}
^^^ Do not change lines above ^^^
For some reason codespell by default ignores .github/ but then
pre-commit is triggering check on those files anyways

=== Do not change lines below ===
{
 "chain": [],
 "cmd": "codespell -w .github/workflows/ensure-uptime-checks.yaml .github/workflows/deploy-hubs.yaml",
 "exit": 0,
 "extra_inputs": [],
 "inputs": [],
 "outputs": [],
 "pwd": "."
}
^^^ Do not change lines above ^^^
=== Do not change lines below ===
{
 "chain": [],
 "cmd": "codespell -w || :",
 "exit": 0,
 "extra_inputs": [],
 "inputs": [],
 "outputs": [],
 "pwd": "."
}
^^^ Do not change lines above ^^^
=== Do not change lines below ===
{
 "chain": [],
 "cmd": "codespell -w -i 3 -C 2",
 "exit": 0,
 "extra_inputs": [],
 "inputs": [],
 "outputs": [],
 "pwd": "."
}
^^^ Do not change lines above ^^^
@yarikoptic
Copy link
Contributor Author

Hi @sgibson91 - what was the decision? I have now refreshed the PR but I think it would not be worthwhile the effort if there is no further interest from 2i2c.

Copy link
Member

@yuvipanda yuvipanda left a comment

Choose a reason for hiding this comment

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

First, I want to apologize for the long long wait here, @yarikoptic! We've been a little swamped, and I must've consumed too much content about GPT tools causing issues in open source projects because somehow I just assumed this was an automated PR - and did not actually follow through to check. I apologize for not doing more due diligence here.

I had also assumed that codespell was a spell checker, and we'll need to maintain a list of 'exempt' words. Turns out this is actually not the case! From https://github.com/codespell-project/codespell,

It's designed primarily for checking misspelled words in source code (backslash escapes are skipped), but it can be used with other files as well. It does not check for word membership in a complete dictionary, but instead looks for a set of common misspellings. Therefore it should catch errors like "adn", but it will not catch "adnasdfasdf". This also means it shouldn't generate false-positives when you use a niche term it doesn't know about.

So it looks like it will primarily fix the common ways specific words are misspelled, rather than a general dictionary. Often @sgibson91 catches these errors in the PRs I make, for example. So I can see how this is generally very useful!

I also don't think there's any security considerations here that are harder than regular security considerations for pre-commit anyway.

So I think this is good to go. Unless there are objections from anyone, I'll merge this next Wednesday (Jan 31)

Thank you for your patience as we worked through this, @yarikoptic! In general PRs modifying actual config from folks in the community those hubs are serving get looked at much faster than this :)

@yarikoptic
Copy link
Contributor Author

I had also assumed that codespell was a spell checker, and we'll need to maintain a list of 'exempt' words.

I just want to clarify that you might still need to do that since by default codespell e.g. uses a dictionary with rare words - ie where typos are still valid but rare words. Or some times it is some sentence not in English or some odd variable name etc. Hence there is that config where I already added a few skips on files and 1 exempt word: https://github.com/2i2c-org/infrastructure/pull/3098/files#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711R15 .

Overall -- it would still be worth to eyeball if there is no some false positive or an undesired code change in this PR diff.

@@ -297,7 +297,7 @@ grafana:
# prometheus and grafana.
#
# Grafana's memory use seems to increase over time but seems reasonable to
# stay below 200Mi for years to come. Grafana's CPU use seems miniscule with
# stay below 200Mi for years to come. Grafana's CPU use seems minuscule with
Copy link
Contributor Author

Choose a reason for hiding this comment

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

e.g. here is a case of a "rare" word -- AFAIK minuscule is a more proper/older version, but recently miniscule also got to be used

Copy link
Member

Choose a reason for hiding this comment

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

right. this is also why i like this being pre-commit, because it just fixes it and there's no discussion that needs to be had. pre-commit imperialism ftw ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just to make sure it was not missed since I failed to mention in PR description -- there is pre-commit config provided too in this PR: https://github.com/2i2c-org/infrastructure/pull/3098/files#diff-63a9c44a44acf85fea213a857769990937107cf072831e1a26808cfde9d096b9

@yuvipanda
Copy link
Member

@yarikoptic yep that makes sense - I'm ok with that, since the list of exceptions is much fewer (aks I guess is a common misspelling of ask). I did eyeball this change and it looks ok. What I didn't want was to end up having to maintain something like https://github.com/jupyterhub/jupyterhub/blob/041acbc0bf186f2810816d16be4c65af93d84795/docs/source/spelling_wordlist.txt#L162 which is much bigger :)

@yuvipanda
Copy link
Member

It's wednesday, mergey mergey.

Thank you for your patience, @yarikoptic!

@yuvipanda yuvipanda merged commit 0c0a756 into 2i2c-org:master Feb 1, 2024
35 checks passed
Copy link

github-actions bot commented Feb 1, 2024

🎉🎉🎉🎉

Monitor the deployment of the hubs here 👉 https://github.com/2i2c-org/infrastructure/actions/runs/7736874709

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done 🎉
Development

Successfully merging this pull request may close these issues.

3 participants