From ef8acef473a104e9c4e6e6bde4bb7797466dd9c1 Mon Sep 17 00:00:00 2001 From: Simon <10352679+simonhammes@users.noreply.github.com> Date: Sun, 17 Nov 2024 14:41:58 +0100 Subject: [PATCH] Add typos CI check (#1234) Co-authored-by: simonhammes --- .github/workflows/test.yml | 7 +++++++ .typos.toml | 19 +++++++++++++++++++ pyinfra/operations/docker.py | 12 ++++++------ 3 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 .typos.toml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f7d1be212..39763f9c3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,6 +33,13 @@ jobs: - run: pip install '.[test]' - run: mypy + spell-check: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v4 + - name: Check spelling + uses: crate-ci/typos@v1.26.8 + # Unit tests # diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 000000000..186698e11 --- /dev/null +++ b/.typos.toml @@ -0,0 +1,19 @@ +[files] +extend-exclude = [ + "tests/facts/apt.SimulateOperationWillChange/upgrade.json", + "tests/words.txt", +] + +[default] +extend-ignore-re = [ + "shell\\('uptim'\\)", + '"fpr:::::::::', + '== "fpr":', + "00740ba1", + "forr something in", + "unknown tag 'forr'", + "nd6 options=", +] + +[default.extend-words] +datas = "datas" diff --git a/pyinfra/operations/docker.py b/pyinfra/operations/docker.py index f92e08c61..24c674d43 100644 --- a/pyinfra/operations/docker.py +++ b/pyinfra/operations/docker.py @@ -30,9 +30,9 @@ def container( + networks: network list to attach on container + ports: port list to expose + volumes: volume list to map on container - + env_vars: environment varible list to inject on container + + env_vars: environment variable list to inject on container + pull_always: force image pull - + force: remove a contaner with same name and create a new one + + force: remove a container with same name and create a new one + present: whether the container should be up and running + start: start or stop the container @@ -125,7 +125,7 @@ def image(image, present=True): Manage Docker images + image: Image and tag ex: nginx:alpine - + present: whether the Docker image should be exist + + present: whether the Docker image should exist **Examples:** @@ -188,7 +188,7 @@ def volume(volume, driver="", labels=None, present=True): if present: if existent_volume: - host.noop("Volume alredy exist!") + host.noop("Volume already exists!") return yield handle_docker( @@ -261,7 +261,7 @@ def network( if present: if existent_network: - host.noop("Alredy exist a network with {0} name!".format(network)) + host.noop("Network {0} already exists!".format(network)) return yield handle_docker( @@ -284,7 +284,7 @@ def network( else: if existent_network is None: - host.noop("Ther is not network with {0} name!".format(network)) + host.noop("Network {0} does not exist!".format(network)) return yield handle_docker(