From cf0bd41891a30f16cee5e0238723975a10c7bc55 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 29 Oct 2024 11:30:48 -0400 Subject: [PATCH 1/4] Add github action to codespell main on push and PRs --- .github/workflows/codespell.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/codespell.yml diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 0000000..b231667 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -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 From 6c720f23d364c9cc04be1db066a2c2f4595c6857 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 29 Oct 2024 11:30:48 -0400 Subject: [PATCH 2/4] Add rudimentary codespell config --- pyproject.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 177b188..54c4735 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = '' From 65f7444544a37fd4362ef469b17732f702b953b6 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 29 Oct 2024 11:31:25 -0400 Subject: [PATCH 3/4] [DATALAD RUNCMD] run codespell throughout fixing few left typos automagically === Do not change lines below === { "chain": [], "cmd": "codespell -w", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- daiquiri/handlers.py | 2 +- daiquiri/output.py | 8 ++++---- doc/source/index.rst | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/daiquiri/handlers.py b/daiquiri/handlers.py index c6d026d..5fead24 100644 --- a/daiquiri/handlers.py +++ b/daiquiri/handlers.py @@ -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 diff --git a/daiquiri/output.py b/daiquiri/output.py index 73cbf97..4feee85 100644 --- a/daiquiri/output.py +++ b/daiquiri/output.py @@ -75,7 +75,7 @@ def _get_log_file_path( class File(Output): - """Ouput to a file.""" + """Output to a file.""" def __init__( self, @@ -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. @@ -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. @@ -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. diff --git a/doc/source/index.rst b/doc/source/index.rst index f45a9d2..46a0a3f 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -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`). From 85adec00fba345537810bff2b7a11d50b33b3031 Mon Sep 17 00:00:00 2001 From: Mehdi ABAAKOUK Date: Wed, 27 Nov 2024 10:25:08 +0100 Subject: [PATCH 4/4] Update .github/workflows/codespell.yml --- .github/workflows/codespell.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index b231667..c72b52a 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -3,8 +3,6 @@ name: Codespell on: - push: - branches: [main] pull_request: branches: [main]