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 support (config, workflow to detect/not fix) and make it fix few typos #193

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[codespell]
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
skip = .git*,.codespellrc
check-hidden = true
# ignore-regex =
# ignore-words-list =
25 changes: 25 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Codespell configuration is within .codespellrc
---
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: Annotate locations with typos
uses: codespell-project/codespell-problem-matcher@v1
- name: Codespell
uses: codespell-project/actions-codespell@v2
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,9 @@ upon setup.
├── MANIFEST.in <- Packaging information for pip
├── README.md <- Description of project which GitHub will render
├── {{repo_name}} <- Basic Python Package import file
│ ├── {{first_module_name}}.py <- Starting packge module
│ ├── {{first_module_name}}.py <- Starting package module
│ ├── __init__.py <- Basic Python Package import file
│ ├── _version.py <- Generated file from VersionInGit. Created on package install, not initilization.
│ ├── _version.py <- Generated file from VersionInGit. Created on package install, not initialization.
│ ├── data <- Sample additional data (non-code) which can be packaged. Just an example, delete in production
│ │   ├── README.md
│ │   └── look_and_say.dat
Expand All @@ -347,7 +347,7 @@ upon setup.
│   ├── getting_started.rst
│   ├── index.rst
│   ├── make.bat
│   └── requirements.yaml <- Documenation building specific requirements. Usually a smaller set than the main program
│   └── requirements.yaml <- Documentation building specific requirements. Usually a smaller set than the main program
├── pyproject.toml <- Generic Python build system configuration (PEP-517).
├── readthedocs.yml
├── setup.cfg <- Near-master config file to make house INI-like settings for Coverage, Flake8, YAPF, etc.
Expand Down
2 changes: 1 addition & 1 deletion hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


def decode_string(string):
"""Helper function to covert byte-string to string, but allows normal strings"""
"""Helper function to convert byte-string to string, but allows normal strings"""
try:
return string.decode()
except AttributeError:
Expand Down
2 changes: 1 addition & 1 deletion {{cookiecutter.repo_name}}/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.

# Incase the project was not installed
# In case the project was not installed
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
Expand Down