From a588589715bf526f964c5190254f5404244b3b87 Mon Sep 17 00:00:00 2001 From: Danny Staple Date: Sun, 12 Feb 2023 12:03:47 +0000 Subject: [PATCH 1/8] Add a linter workflow --- .github/workflows/on-pr-lint.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/workflows/on-pr-lint.yml diff --git a/.github/workflows/on-pr-lint.yml b/.github/workflows/on-pr-lint.yml new file mode 100644 index 0000000..8578b42 --- /dev/null +++ b/.github/workflows/on-pr-lint.yml @@ -0,0 +1,11 @@ +name: Lint on Pull Request +on: + pull-request: + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + # megalinter + - uses: nvuillam/mega-linter@v4 From 77f85b06e0deac20590a5006b29d03f1657b93ca Mon Sep 17 00:00:00 2001 From: Danny Staple Date: Sun, 12 Feb 2023 12:05:11 +0000 Subject: [PATCH 2/8] Typo --- .github/workflows/on-pr-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/on-pr-lint.yml b/.github/workflows/on-pr-lint.yml index 8578b42..7f9b3dc 100644 --- a/.github/workflows/on-pr-lint.yml +++ b/.github/workflows/on-pr-lint.yml @@ -1,6 +1,6 @@ name: Lint on Pull Request on: - pull-request: + pull_request: jobs: lint: From 053fbe8749c269589ccece52393090b3e9ade354 Mon Sep 17 00:00:00 2001 From: Danny Staple Date: Sun, 12 Feb 2023 13:01:46 +0000 Subject: [PATCH 3/8] Try hit the spelling issues --- .cspell.json | 19 +++++++++++++++++++ .github/workflows/build-and-publish.yml | 1 + .github/workflows/on-pr-lint.yml | 4 ++++ README.md | 2 +- coder_dojo_common/settings.py | 2 +- 5 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 .cspell.json diff --git a/.cspell.json b/.cspell.json new file mode 100644 index 0000000..9e18aeb --- /dev/null +++ b/.cspell.json @@ -0,0 +1,19 @@ +// cSpell Settings +{ + // Version of the setting file. Always 0.2 + "version": "0.2", + // language - current active spelling language + "language": "en", + "dictionaries": ["en-gb", "companies", "softwareTerms", "misc", "python", "bash", "filetypes"], + // words - list of words to be always considered correct + "words": [ + "Kenney", + "commandline", + "pyproject", + "pydantic", + "pipx" + ], + "ignorePaths": [ + ".gitignore" + ] +} diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index 024dc7c..ee22ad1 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -1,3 +1,4 @@ +# cspell: ignore marvinpinto, pypa name: Build and publish on: diff --git a/.github/workflows/on-pr-lint.yml b/.github/workflows/on-pr-lint.yml index 7f9b3dc..7dc629f 100644 --- a/.github/workflows/on-pr-lint.yml +++ b/.github/workflows/on-pr-lint.yml @@ -1,3 +1,5 @@ +# cspell: ignore nvuillam + name: Lint on Pull Request on: pull_request: @@ -9,3 +11,5 @@ jobs: - uses: actions/checkout@v2 # megalinter - uses: nvuillam/mega-linter@v4 + # with: + # SPELL_CSPELL_DISABLE_ERRORS: true diff --git a/README.md b/README.md index add9034..a0b0621 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ requests = { version = "^2.28.2", optional = true } # Package added as optional [tool.poetry.extras] #...existing extras... -web = ["requesets"] # A new extra 'web' +web = ["requests"] # A new extra 'web' ``` ### Build package diff --git a/coder_dojo_common/settings.py b/coder_dojo_common/settings.py index 703bdeb..337d96d 100644 --- a/coder_dojo_common/settings.py +++ b/coder_dojo_common/settings.py @@ -9,7 +9,7 @@ class CoderDojoSettings(BaseSettings): # Configuration class Config: """ - Set env prefix, root values can be overriden from environment variables prefixed with CODER_DOJO_ + Set env prefix, root values can be overridden from environment variables prefixed with CODER_DOJO_ e.g. CODER_DOJO_ROOT_DIR=/tmp From 299e7014666f4b6d3fa6b117cb766e96121caae0 Mon Sep 17 00:00:00 2001 From: Danny Staple Date: Sun, 12 Feb 2023 13:07:19 +0000 Subject: [PATCH 4/8] Isort --- coder_dojo_common/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coder_dojo_common/models.py b/coder_dojo_common/models.py index bf4e546..8449d92 100644 --- a/coder_dojo_common/models.py +++ b/coder_dojo_common/models.py @@ -5,7 +5,7 @@ import json from datetime import datetime, timedelta from pathlib import Path -from typing import Optional, Union, Iterator +from typing import Iterator, Optional, Union from pydantic import BaseModel from requests import Session From 2783b70b9b1b60da8bdae797d4e95fc203599730 Mon Sep 17 00:00:00 2001 From: Danny Staple Date: Sun, 12 Feb 2023 13:12:30 +0000 Subject: [PATCH 5/8] Shellcheck issues --- .github/workflows/build-and-publish.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index ee22ad1..1758e63 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -35,12 +35,15 @@ jobs: - run: poetry install - - run: PKG_VERSION=$(poetry version --short) && echo $PKG_VERSION && echo "value=$PKG_VERSION" >> $GITHUB_OUTPUT + - run: | + PKG_VERSION=$(poetry version --short) && \ + echo "$PKG_VERSION" && \ + echo "value=$PKG_VERSION" >> "$GITHUB_OUTPUT" id: pkg_version - run: poetry build - - - run: echo "value=$(ls dist/*.tar.gz | sed 's/.tar.gz//' | xargs basename)" >> $GITHUB_OUTPUT + # shellcheck disable=SC2012 + - run: echo "value=$(ls dist/*.tar.gz | sed 's/.tar.gz//' | xargs basename)" >> "$GITHUB_OUTPUT" id: dist_folder - name: Publish distribution to GitHub From fceb95782d3e96d7ca0ae5eb4712e9ec3ba4d8eb Mon Sep 17 00:00:00 2001 From: Danny Staple Date: Sun, 12 Feb 2023 13:20:00 +0000 Subject: [PATCH 6/8] Json comments not valid there. Make mypy linting warning only for now. --- .cspell.json | 4 ---- .github/workflows/on-pr-lint.yml | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.cspell.json b/.cspell.json index 9e18aeb..b8eb377 100644 --- a/.cspell.json +++ b/.cspell.json @@ -1,11 +1,7 @@ -// cSpell Settings { - // Version of the setting file. Always 0.2 "version": "0.2", - // language - current active spelling language "language": "en", "dictionaries": ["en-gb", "companies", "softwareTerms", "misc", "python", "bash", "filetypes"], - // words - list of words to be always considered correct "words": [ "Kenney", "commandline", diff --git a/.github/workflows/on-pr-lint.yml b/.github/workflows/on-pr-lint.yml index 7dc629f..8d3f855 100644 --- a/.github/workflows/on-pr-lint.yml +++ b/.github/workflows/on-pr-lint.yml @@ -11,5 +11,5 @@ jobs: - uses: actions/checkout@v2 # megalinter - uses: nvuillam/mega-linter@v4 - # with: - # SPELL_CSPELL_DISABLE_ERRORS: true + with: + PYTHON_MYPY_DISABLE_ERRORS: true From 817203d7b8aaf262dde9d6caff055b0d5f070803 Mon Sep 17 00:00:00 2001 From: Danny Staple Date: Mon, 13 Feb 2023 08:49:00 +0000 Subject: [PATCH 7/8] This should be using v6. YAML lint fixes --- .github/dependabot.yml | 2 +- .github/workflows/build-and-publish.yml | 3 ++- .github/workflows/install-package.yml | 2 +- .github/workflows/on-pr-lint.yml | 5 +++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index b5b392c..bd994bf 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -2,7 +2,7 @@ # package ecosystems to update and where the package manifests are located. # Please see the documentation for all configuration options: # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates - +--- version: 2 updates: - package-ecosystem: "poetry" # See documentation for possible values diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index 1758e63..240b9e8 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -1,3 +1,4 @@ +--- # cspell: ignore marvinpinto, pypa name: Build and publish @@ -58,4 +59,4 @@ jobs: uses: pypa/gh-action-pypi-publish@master with: user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} \ No newline at end of file + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/install-package.yml b/.github/workflows/install-package.yml index 80b9c69..a0df3ca 100644 --- a/.github/workflows/install-package.yml +++ b/.github/workflows/install-package.yml @@ -1,3 +1,4 @@ +--- name: Install package on: @@ -38,4 +39,3 @@ jobs: - run: poetry install - run: poetry version - diff --git a/.github/workflows/on-pr-lint.yml b/.github/workflows/on-pr-lint.yml index 8d3f855..a5821fb 100644 --- a/.github/workflows/on-pr-lint.yml +++ b/.github/workflows/on-pr-lint.yml @@ -1,3 +1,4 @@ +--- # cspell: ignore nvuillam name: Lint on Pull Request @@ -9,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - # megalinter - - uses: nvuillam/mega-linter@v4 + + - uses: nvuillam/mega-linter@v6 with: PYTHON_MYPY_DISABLE_ERRORS: true From b225e4bf150313784622246cd2a7dd41cfce0c0a Mon Sep 17 00:00:00 2001 From: Danny Staple Date: Mon, 13 Feb 2023 08:52:05 +0000 Subject: [PATCH 8/8] PIp is supposed to be used even for th epoetry ecosystem --- .github/dependabot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index bd994bf..ae6e492 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,7 +5,7 @@ --- version: 2 updates: - - package-ecosystem: "poetry" # See documentation for possible values + - package-ecosystem: "pip" # See documentation for possible values directory: "/" # Location of package manifests schedule: interval: "weekly"