Add codespell configuration, workflow, pre-commit config and fix few typos (#1842)

* Add github action to codespell main on push and PRs

Signed-off-by: Yaroslav Halchenko <debian@onerussian.com>

* Add rudimentary codespell config

Signed-off-by: Yaroslav Halchenko <debian@onerussian.com>

* Add pre-commit definition for codespell

Signed-off-by: Yaroslav Halchenko <debian@onerussian.com>

* skip tests and dotfiles for codespell

Signed-off-by: Yaroslav Halchenko <debian@onerussian.com>

* [DATALAD RUNCMD] run codespell throughout fixing typo automagically

=== Do not change lines below ===
{
 "chain": [],
 "cmd": "codespell -w",
 "exit": 0,
 "extra_inputs": [],
 "inputs": [],
 "outputs": [],
 "pwd": "."
}
^^^ Do not change lines above ^^^

Signed-off-by: Yaroslav Halchenko <debian@onerussian.com>

* Fix spells

* Fix config

* pre-commit: exclude tests

---------

Signed-off-by: Yaroslav Halchenko <debian@onerussian.com>
Co-authored-by: Koudai Aono <koxudaxi@gmail.com>
This commit is contained in:
Yaroslav Halchenko
2024-02-13 12:24:36 -05:00
committed by GitHub
parent edaa234582
commit 2d0f900d5a
11 changed files with 54 additions and 16 deletions

23
.github/workflows/codespell.yml vendored Normal file
View File

@@ -0,0 +1,23 @@
# Codespell configuration is within pyproject.toml
---
name: Codespell
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Codespell
uses: codespell-project/actions-codespell@v2

View File

@@ -9,3 +9,11 @@ repos:
- id: ruff-format
files: "^datamodel_code_generator|^tests"
exclude: "^tests/data"
- repo: https://github.com/codespell-project/codespell
# Configuration for codespell is in pyproject.toml
rev: v2.2.6
hooks:
- id: codespell
additional_dependencies:
- tomli
exclude: "^tests/"

View File

@@ -422,7 +422,7 @@ Model customization:
--enable-version-header
Enable package version on file headers
--keep-model-order Keep generated models' order
--reuse-model Re-use models on the field when a module has the model
--reuse-model Reuse models on the field when a module has the model
with the same content
--target-python-version {3.6,3.7,3.8,3.9,3.10,3.11}
target python version (default: 3.7)

View File

@@ -525,7 +525,7 @@ def infer_input_type(text: str) -> InputFileType:
inferred_message = (
'The input file type was determined to be: {}\nThis can be specificied explicitly with the '
'The input file type was determined to be: {}\nThis can be specified explicitly with the '
'`--input-file-type` option.'
)

View File

@@ -419,7 +419,7 @@ Model customization:
--enable-version-header
Enable package version on file headers
--keep-model-order Keep generated models' order
--reuse-model Re-use models on the field when a module has the model
--reuse-model Reuse models on the field when a module has the model
with the same content
--target-python-version {3.6,3.7,3.8,3.9,3.10,3.11}
target python version (default: 3.7)

View File

@@ -153,3 +153,10 @@ ignore-init-method-arguments = true
[tool.pydantic-pycharm-plugin.parsable-types]
# str field may parse int and float
str = ["int", "float"]
[tool.codespell]
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
skip = '.git,*.lock,tests'
# check-hidden = true
# ignore-regex = ''
# ignore-words-list = ''

View File

@@ -23107,7 +23107,7 @@ Reactor: TypeAlias = Union[
]
# Any referencable object
# Any referenceable object
ReferencedSubject: TypeAlias = Union[
'Issue',
'PullRequest',

View File

@@ -12,7 +12,7 @@ from pydantic import AnyUrl, BaseModel, Field, conint
class Problem(BaseModel):
detail: Optional[str] = Field(
None,
description='A human readable explanation specific to this occurrence of the\nproblem. You MUST NOT expose internal informations, personal\ndata or implementation details through this field.\n',
description='A human readable explanation specific to this occurrence of the\nproblem. You MUST NOT expose internal information, personal\ndata or implementation details through this field.\n',
example='Request took too long to complete.',
)
instance: Optional[AnyUrl] = Field(

View File

@@ -3398,7 +3398,7 @@ input CheckRunFilter {
conclusions: [CheckConclusionState!]
"""
Filters the check runs by this status. Superceded by statuses.
Filters the check runs by this status. Superseded by statuses.
"""
status: CheckStatusState
@@ -12265,14 +12265,14 @@ input EnablePullRequestAutoMergeInput {
clientMutationId: String
"""
Commit body to use for the commit when the PR is mergable; if omitted, a
Commit body to use for the commit when the PR is mergeable; if omitted, a
default message will be used. NOTE: when merging with a merge queue any input
value for commit message is ignored.
"""
commitBody: String
"""
Commit headline to use for the commit when the PR is mergable; if omitted, a
Commit headline to use for the commit when the PR is mergeable; if omitted, a
default message will be used. NOTE: when merging with a merge queue any input
value for commit headline is ignored.
"""
@@ -20934,7 +20934,7 @@ type MergeQueueConfiguration {
minimumEntriesToMerge: Int
"""
The amount of time in minutes to wait before ignoring the minumum number of
The amount of time in minutes to wait before ignoring the minimum number of
entries in the queue requirement and merging a collection of entries
"""
minimumEntriesToMergeWaitTime: Int
@@ -21085,7 +21085,7 @@ enum MergeQueueMergingStrategy {
ALLGREEN
"""
Failing Entires are allowed to merge if they are with a passing entry.
Failing Entries are allowed to merge if they are with a passing entry.
"""
HEADGREEN
}
@@ -33912,7 +33912,7 @@ The possible roles of a collaborator on a project.
"""
enum ProjectV2Roles {
"""
The collaborator can view, edit, and maange the settings of the project
The collaborator can view, edit, and manage the settings of the project
"""
ADMIN
@@ -39277,7 +39277,7 @@ type ReferencedEvent implements Node {
}
"""
Any referencable object
Any referenceable object
"""
union ReferencedSubject = Issue | PullRequest
@@ -54687,12 +54687,12 @@ enum ThreadSubscriptionState {
IGNORING_THREAD
"""
The User is not recieving notifications from this thread
The User is not receiving notifications from this thread
"""
NONE
"""
The User is notified becuase they are watching the list
The User is notified because they are watching the list
"""
SUBSCRIBED_TO_LIST

View File

@@ -5,7 +5,7 @@ schemas:
detail:
description: |
A human readable explanation specific to this occurrence of the
problem. You MUST NOT expose internal informations, personal
problem. You MUST NOT expose internal information, personal
data or implementation details through this field.
example: Request took too long to complete.
type: string

View File

@@ -100,7 +100,7 @@ paths:
items:
$ref: "#/components/schemas/Pet"
'500':
description: An internal error occured
description: An internal error occurred
content:
application/json:
schema: