Skip to content

Commit

Permalink
Merge pull request #49 from yarikoptic/enh-codespell
Browse files Browse the repository at this point in the history
Add codespell support (config, workflow to detect/not fix) and make it fix few typos
  • Loading branch information
piyueh authored Jul 24, 2024
2 parents 0ccddd8 + 21239b9 commit eaf746e
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 2 deletions.
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 pyproject.toml
---
name: Codespell

on:
push:
branches: [master]
pull_request:
branches: [master]

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
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,11 @@ repos:
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files

- repo: https://github.com/codespell-project/codespell
# Configuration for codespell is in pyproject.toml
rev: v2.2.6
hooks:
- id: codespell
additional_dependencies:
- tomli
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ An ``IMAP4`` instance has the following methods:
List *subscribed* mailbox names in directory matching pattern.
Returned *data* are tuples of message part envelope and data.
``myrights``\ (*mailbox*)
Show my Access Controll Lists for *mailbox* (i.e. the rights that I
Show my Access Control Lists for *mailbox* (i.e. the rights that I
have on *mailbox*).
``namespace``\ ()
Returns IMAP namespaces per RFC2342.
Expand Down
2 changes: 1 addition & 1 deletion imaplib2/imaplib2.py
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ def deleteacl(self, mailbox, who, **kw):
def enable(self, capability):
"""Send an RFC5161 enable string to the server.
(typ, [data]) = <intance>.enable(capability)
(typ, [data]) = <instance>.enable(capability)
"""
if 'ENABLE' not in self.capabilities:
raise self.error("Server does not support ENABLE")
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,10 @@ deps =
commands =
pytest {posargs}
"""

[tool.codespell]
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
skip = '.git*'
check-hidden = true
# ignore-regex = ''
ignore-words-list = 'donn'

0 comments on commit eaf746e

Please sign in to comment.