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 #82

Open
wants to merge 3 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
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: [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
2 changes: 1 addition & 1 deletion daiquiri/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def format(self, record: logging.LogRecord) -> str:
try:
record._stream_is_a_tty = self.stream.isatty()
except ValueError:
# Stream has been closed, usually during interpretor shutdown
# Stream has been closed, usually during interpreter shutdown
record._stream_is_a_tty = False
else:
record._stream_is_a_tty = False
Expand Down
8 changes: 4 additions & 4 deletions daiquiri/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def _get_log_file_path(


class File(Output):
"""Ouput to a file."""
"""Output to a file."""

def __init__(
self,
Expand All @@ -93,7 +93,7 @@ def __init__(

:param directory: The log directory to write to. If no filename is
specified, the program name and suffix will be used
to contruct the full path relative to the directory.
to construct the full path relative to the directory.

:param suffix: The log file name suffix. This will be only used if no
filename has been provided.
Expand Down Expand Up @@ -129,7 +129,7 @@ def __init__(

:param directory: The log directory to write to. If no filename is
specified, the program name and suffix will be used
to contruct the full path relative to the directory.
to construct the full path relative to the directory.

:param suffix: The log file name suffix. This will be only used if no
filename has been provided.
Expand Down Expand Up @@ -179,7 +179,7 @@ def __init__(

:param directory: The log directory to write to. If no filename is
specified, the program name and suffix will be used
to contruct the full path relative to the directory.
to construct the full path relative to the directory.

:param suffix: The log file name suffix. This will be only used if no
filename has been provided.
Expand Down
2 changes: 1 addition & 1 deletion doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Picking format
--------------

You can configure the format of any output by passing a formatter as the
`formatter` argument to the contructor. Two default formatters are available:
`formatter` argument to the constructor. Two default formatters are available:
`daiquiri.formatter.TEXT_FORMATTER` which prints log messages as text, and the
`daiquiri.formatter.JSON_FORMATTER` which prints log messages as parsable JSON
(requires `python-json-logger`).
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,10 @@ module = [
"systemd",
]
ignore_missing_imports = true

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