Skip to content

ci: add codespell spell-check workflow#417

Open
dev-aditya-hub wants to merge 2 commits intokubeedge:mainfrom
dev-aditya-hub:ci/add-spell-check-workflow
Open

ci: add codespell spell-check workflow#417
dev-aditya-hub wants to merge 2 commits intokubeedge:mainfrom
dev-aditya-hub:ci/add-spell-check-workflow

Conversation

@dev-aditya-hub
Copy link
Copy Markdown

Summary

  • Adds .github/workflows/spell-check.yml that runs codespell on every push to main and every pull_request, preventing new spelling errors from landing in core/
  • Adds .codespellrc to configure the check: scope is core/ only; examples/ and docs/proposals/ contain pre-existing issues from many contributors and are tracked separately
  • Fixes all typos that the new check surfaces in core/:
    • DeafultDefault (core/common/log.py)
    • caculatecalculate (federated_class_incremental_learning.py)
    • enviromentenvironment (simulation.py, simulation_system_admin.py)
    • segmantationsegmentation (dataset.py)

Why codespell

codespell is lightweight (pure Python, zero system deps), widely used in CNCF projects, and integrates in one pip install step — no extra Actions or third-party integrations required.

Test plan

  • CI workflow runs on this PR and exits 0
  • codespell --config .codespellrc core exits 0 locally after applying the typo fixes

Fixes #232

Signed-off-by: dev-aditya-hub premjadhvar95@gmail.com

@kubeedge-bot kubeedge-bot added the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label May 7, 2026
@kubeedge-bot
Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dev-aditya-hub
To complete the pull request process, please assign moorezheng after the PR has been reviewed.
You can assign the PR to them by writing /assign @moorezheng in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubeedge-bot kubeedge-bot requested review from MooreZheng and hsj576 May 7, 2026 13:29
@kubeedge-bot kubeedge-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 7, 2026
Add .github/workflows/spell-check.yml running codespell on every push
and pull_request, and a .codespellrc limiting the check to core/.

Fix all typos caught by the new check:
- Deafult -> Default (log.py)
- caculate -> calculate (federated_class_incremental_learning.py)
- enviroment -> environment (simulation.py, simulation_system_admin.py)
- segmantation -> segmentation (dataset.py)

Signed-off-by: dev-aditya-hub <premjadhvar95@gmail.com>
@dev-aditya-hub dev-aditya-hub force-pushed the ci/add-spell-check-workflow branch from 9b9abc1 to 8b321bc Compare May 7, 2026 13:30
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request corrects various spelling errors across the codebase, specifically targeting terms like "environment", "calculate", "default", and "segmentation". It also introduces a .codespellrc configuration file to help maintain spelling integrity. The review feedback suggests several improvements: aligning the .codespellrc skip list with its internal documentation, fixing a grammatical error in a log message, correcting the "destory" typo in a function name, and updating a docstring that incorrectly describes a destruction function as a build function.

Comment thread .codespellrc
[codespell]
# examples/ and docs/proposals/ contain pre-existing issues from many
# contributors; they are tracked separately. CI focuses on core/ only.
skip = *.pyc,__pycache__,*.egg-info,.git
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The configuration file mentions that examples/ and docs/proposals/ should be skipped, but they are not included in the skip list. Adding them here ensures that codespell behaves as intended even if run without explicit path arguments.

skip = *.pyc,__pycache__,*.egg-info,.git,examples,docs/proposals

if build_simulation_env_ret.returncode == 0:
LOGGER.info(
"Congratulation! The simulation enviroment build successful!")
"Congratulation! The simulation environment build successful!")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

This log message contains a typo ("Congratulation" should be "Congratulations") and the phrasing "build successful" is grammatically incomplete.

Suggested change
"Congratulation! The simulation environment build successful!")
"Congratulations! The simulation environment build was successful!")



def destory_simulation_enviroment(simulation):
def destory_simulation_environment(simulation):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The function name still contains the typo destory (should be destroy). Since this PR is already renaming the function (changing the suffix), it is an appropriate time to fix the prefix as well.

Suggested change
def destory_simulation_environment(simulation):
def destroy_simulation_environment(simulation):

def destory_simulation_environment(simulation):
"""
build the simulation enviroment
build the simulation environment
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The docstring for the destruction function incorrectly states it "builds" the environment. It should be updated to reflect that it destroys or cleans up the environment.

Suggested change
build the simulation environment
destroy the simulation environment

@kubeedge-bot kubeedge-bot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label May 7, 2026
- "os" -> "of" in RuntimeError message (check_host_cpu)
- rename destory_simulation_environment -> destroy_simulation_environment
- fix docstring: "build" -> "destroy" for destroy_simulation_environment

Signed-off-by: dev-aditya-hub <premjadhvar95@gmail.com>
@dev-aditya-hub
Copy link
Copy Markdown
Author

/assign @MooreZheng

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix various spelling errors and typos in the documentation and code comments

3 participants