From b936b349d2d898253d247032e5d98c87e949f67e Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 18 Apr 2024 15:54:47 -0400 Subject: [PATCH 1/3] Add github action to codespell master on push and PRs --- .github/workflows/codespell.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 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..eeacead --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,23 @@ +# Codespell configuration is within .codespellrc +--- +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: Codespell + uses: codespell-project/actions-codespell@v2 From 7a04935c684fa667230463f025322ec3d5063629 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 18 Apr 2024 15:54:47 -0400 Subject: [PATCH 2/3] Add rudimentary codespell config --- .codespellrc | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .codespellrc diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000..1cd4cac --- /dev/null +++ b/.codespellrc @@ -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 = From b909fc30734fdfbc8aab6b6bcc7de71441551cd9 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 18 Apr 2024 15:54:51 -0400 Subject: [PATCH 3/3] [DATALAD RUNCMD] run codespell throughout fixing typos automagically === Do not change lines below === { "chain": [], "cmd": "codespell -w", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- duct.py | 2 +- gotchas.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/duct.py b/duct.py index 005114e..16c083c 100644 --- a/duct.py +++ b/duct.py @@ -913,7 +913,7 @@ def repr_expression(expression): @contextmanager def new_iocontext(): # Hardcode the standard file descriptors. We can't rely on None here, - # becase stdout/stderr swapping needs to work. + # because stdout/stderr swapping needs to work. context = IOContext( stdin=0, stdout=1, diff --git a/gotchas.md b/gotchas.md index d591862..5df820b 100644 --- a/gotchas.md +++ b/gotchas.md @@ -152,7 +152,7 @@ path on Windows. ## Preventing `dir` from affecting relative program paths on Unix Windows and Unix take different approaches to setting a child's working -directory. The `CreateProcess` function on Windows has an explict +directory. The `CreateProcess` function on Windows has an explicit `lpCurrentDirectory` argument, while most Unix platforms call `chdir` in between `fork` and `exec`. Unfortunately, those two approaches give different results when you have a _relative path_ to the child executable. On Windows the @@ -231,7 +231,7 @@ already needs to think about failure handling and data corruption. When input bytes are supplied or output bytes are captured, Duct's `start` method uses background threads to do IO, so that IO makes progress even if `wait` is never called. Duct's `reader` method doesn't use a thread for -standard ouput, since that's left to the caller, but it still uses background +standard output, since that's left to the caller, but it still uses background threads to supply input bytes or to capture standard error. Consider the following scenario. You want to spawn two child processes, which @@ -285,7 +285,7 @@ p.wait() That is, `test1.py` starts a `sleep` child process and then waits on it. And `test2.py` starts `test1.py`, waits for a second, and then kills it. The -question is, if you run `test2.py`, what happpens to the `sleep` process? If +question is, if you run `test2.py`, what happens to the `sleep` process? If you look at something like `pgrep sleep` after `test2.py` exits, you'll see that `sleep` is _still running_. Maybe that's not entirely surprising, since we only killed `test1.py` and didn't explicitly kill `sleep`. But compare that to