From e8afd96606990a653a25802ba257a5ef4abdbc5e Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 17 Jan 2025 13:45:26 -0500 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 ba41b0987d59bc39e5636c29d0b25c850653a86f Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 17 Jan 2025 13:45:26 -0500 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 aa7e766..6074e30 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,10 @@ [tool.isort] profile = "black" multi_line_output = 3 + +[tool.codespell] +# Ref: https://github.com/codespell-project/codespell#using-a-config-file +skip = '.git*' +check-hidden = true +# ignore-regex = '' +# ignore-words-list = '' From bdc977d94d0b9482dea580fd500055eddb281189 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 17 Jan 2025 13:45:53 -0500 Subject: [PATCH 3/4] ignore plural ths --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6074e30..1c60b70 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,4 +7,4 @@ multi_line_output = 3 skip = '.git*' check-hidden = true # ignore-regex = '' -# ignore-words-list = '' +ignore-words-list = 'ths' From 86fe786c72cc4392c4a4444e8f53488d834eea54 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 17 Jan 2025 13:45:58 -0500 Subject: [PATCH 4/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 ^^^ --- test_project/test_dashboard_permissions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_project/test_dashboard_permissions.py b/test_project/test_dashboard_permissions.py index 5a466ec..8910a4d 100644 --- a/test_project/test_dashboard_permissions.py +++ b/test_project/test_dashboard_permissions.py @@ -324,7 +324,7 @@ def test_user_can_edit( assert can_edit_using_admin == expected if can_edit_using_admin: # Check that they cannot edit the SQL queries, because they do not - # have the execute_sql permisssion + # have the execute_sql permission assert not user.has_perm("django_sql_dashboard.execute_sql") html = get_admin_change_form_html(client, user, dashboard_obj) soup = BeautifulSoup(html, "html5lib")