Skip to content

Conversation

@yarikoptic
Copy link
Member

What does this implement/fix? Explain your changes.

codespell config was provided awhile ago but no machinery was actually deployed to ensure that anyone would use it and keep code free of typos. With this PR codebase would be protected at pre-commit and CI levels from typos to enter the code base.

I tried my best to mimic ad-hoc yaml formatting in the rest of the file
=== Do not change lines below ===
{
 "chain": [],
 "cmd": "codespell -w",
 "exit": 0,
 "extra_inputs": [],
 "inputs": [],
 "outputs": [],
 "pwd": "."
}
^^^ Do not change lines above ^^^
- |Fix| :func:`metric.ndcg_score` now gives a meaningful error message for input of
length 1.
:pr:`25672` by :user:`Lene Preuss <lene>` and :user:`Wei-Chun Chu <wcchu>`.
:pr:`25672` by :user:`Lene Preuss <lens>` and :user:`Wei-Chun Chu <wcchu>`.
Copy link
Member

Choose a reason for hiding this comment

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

This one should not be changed this is a github user handle. Not sure what option there is to tell codespell to leave this one alone (and maybe similar ones like <some-text-here-for-a-github-handle> in particular in whats_new rst files).

@glemaitre
Copy link
Member

@yarikoptic Could you push on your fork instead of the main repository?

Copy link
Member

@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

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

In the previous iteration, we did not question whether to integrate or not codespell. It seems that there is only a single false positive.

I would still be +1 going towards having a pre-commit and GitHub action.

@adrinjalali
Copy link
Member

At the last iteration we didn't want to integrate it with CI / pre-commits partially because of the issue @lesteve brings up.

Also, @yarikoptic please never create branches on the main repo, always use forks, please set your git remote of upstream/push to something invalid so that you never accidentally end up pushing to the main repo. (you can also delete this branch, and open a new PR from your fork please)

I'm fine with the changes that this detects, but I'm -0 on adding it to CI if we can't ignore a word from a single file instead of a global ignore.

Copy link
Member

@adrinjalali adrinjalali left a comment

Choose a reason for hiding this comment

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

I removed the action and the pre-commit hook form here, this is now an easy merge. Merging, we can discuss adding the actions in a different thread.

@adrinjalali adrinjalali enabled auto-merge (squash) June 1, 2023 11:54
@adrinjalali adrinjalali changed the title Add codespell action and pre-commit configuration, fix accumulated typos DOC codespell fixes Jun 1, 2023
@adrinjalali adrinjalali merged commit b680a9e into main Jun 1, 2023
@adrinjalali adrinjalali deleted the enh-codespell branch June 1, 2023 15:02
manudarmi pushed a commit to primait/scikit-learn that referenced this pull request Jun 12, 2023
REDVM pushed a commit to REDVM/scikit-learn that referenced this pull request Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants