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 and github action to detect new) + make it fix a few typos #531

Merged
merged 5 commits into from
Mar 7, 2024
Merged
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
7 changes: 7 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[codespell]
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
skip = .git,*.svg,go.sum,*.lock,*.css,.codespellrc
check-hidden = true
# ignore-regex =
# short variables close to typos are often used
ignore-words-list = ot
23 changes: 23 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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: Codespell
uses: codespell-project/actions-codespell@v2
2 changes: 1 addition & 1 deletion docs/source/contrib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Code Structure
- ``internal``: Contains the internal code for the project.

- ``web``: Contains the backend code for the Web UI.
- ``agent``: Contains the code for runnning the workflows.
- ``agent``: Contains the code for running the workflows.
- ``config``: Contains the code for loading the configuration.
- ``controller``: Contains the code for managing the workflows.
- ``dag``: Contains the code for parsing the workflow definition.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/executors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Running Containers on the Host's Docker Environment

If you are running `dagu` using a container, you need the setup below.

1. Run a `socat` conainer with the command below.
1. Run a `socat` container with the command below.

.. code-block:: sh

Expand Down
2 changes: 1 addition & 1 deletion docs/source/yaml_format.rst
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ Example:
dir: ${HOME}/logs
command: bash
stdout: /tmp/outfile
ouptut: RESULT_VARIABLE
output: RESULT_VARIABLE
script: |
echo "any script"
signalOnStop: "SIGINT"
Expand Down
2 changes: 1 addition & 1 deletion internal/persistence/jsondb/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"github.com/dagu-dev/dagu/internal/utils"
)

// Store is the interfact to store dags status in local.
// Store is the interface to store dags status in local.
// It stores status in JSON format in a directory as per each dagFile.
// Multiple JSON data can be stored in a single file and each data
// is separated by newline.
Expand Down
6 changes: 3 additions & 3 deletions internal/utils/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ func TestMustGetwd(t *testing.T) {

func TestFormatTime(t *testing.T) {
tm := time.Date(2022, 2, 1, 2, 2, 2, 0, time.Now().Location())
fomatted := utils.FormatTime(tm)
require.Equal(t, "2022-02-01 02:02:02", fomatted)
formatted := utils.FormatTime(tm)
require.Equal(t, "2022-02-01 02:02:02", formatted)

parsed, err := utils.ParseTime(fomatted)
parsed, err := utils.ParseTime(formatted)
require.NoError(t, err)
require.Equal(t, tm, parsed)

Expand Down