diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index bf89f29b8..21febd549 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -29,24 +29,15 @@ concurrency: jobs: format: name: Check code formatting - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - - name: Install uncrustify - run: | - sudo apt-add-repository --update --yes ppa:pybricks/ppa - sudo apt-get install uncrustify - uncrustify --version - - name: Install python - uses: actions/setup-python@v4 - with: - python-version: '3.6' - - name: Install black - run: python -m pip install black - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true + - run: pipx install poetry + - run: poetry install --only=lint - name: Run codeformat.py run: | - ./tools/codeformat.py + poetry run ./tools/codeformat.py git diff --exit-code diff --git a/poetry.lock b/poetry.lock index f7985d2b4..b9f38b2c0 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1885,6 +1885,26 @@ files = [ {file = "mccabe-0.6.1.tar.gz", hash = "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"}, ] +[[package]] +name = "micropython-uncrustify" +version = "1.0.0.post1" +description = "" +optional = false +python-versions = "*" +files = [ + {file = "micropython_uncrustify-1.0.0.post1-py2.py3-none-macosx_10_9_universal2.macosx_10_9_x86_64.macosx_11_0_arm64.macosx_11_0_universal2.whl", hash = "sha256:4ca4cc35e13f9d5bad97e8d147fd0b08eb565954c2374a69b3038d62735bef64"}, + {file = "micropython_uncrustify-1.0.0.post1-py2.py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:6c0ff6d999ccbd1b78ccf3ce0ef7a0ada01b4ce4fbd9f65f540fddc153f9c6d1"}, + {file = "micropython_uncrustify-1.0.0.post1-py2.py3-none-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:8afa2aa14f25b6aef703d05d75ba4f66b0c200e2b4ce36f218bb67b42b172566"}, + {file = "micropython_uncrustify-1.0.0.post1-py2.py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:0a8e099d7a3b51c203ef2f73cb3d8ac8aea3a491f9e15cf91a0ef94e88d13710"}, + {file = "micropython_uncrustify-1.0.0.post1-py2.py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:ad2d690b13841e82957499e3054ab232bd1905c88c00b5522c374a61e0e59244"}, + {file = "micropython_uncrustify-1.0.0.post1-py2.py3-none-musllinux_1_2_i686.whl", hash = "sha256:464e39edb248704facce4378288149e1acd44f4569ea15a35834d179bd6fc0dc"}, + {file = "micropython_uncrustify-1.0.0.post1-py2.py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:25d657919f5c00eb8b895abca52a24456badde1b1f3407b3024b50ee975e7b6b"}, + {file = "micropython_uncrustify-1.0.0.post1-py2.py3-none-win32.whl", hash = "sha256:a6242d18d98339bf95ab3d7e08582118b0eb6a702043aac159a95ac7e181fc18"}, + {file = "micropython_uncrustify-1.0.0.post1-py2.py3-none-win_amd64.whl", hash = "sha256:9e6d264a2891b1088352c79c1916366f1b2c69988b4a9b8e9b8178ab801ef369"}, + {file = "micropython_uncrustify-1.0.0.post1-py2.py3-none-win_arm64.whl", hash = "sha256:7285fb0b6ea30567834d86eb797369c8d8fcf41c041413305a0c0bc681b69a1f"}, + {file = "micropython_uncrustify-1.0.0.post1.tar.gz", hash = "sha256:11cff928b20048526f94685970b66daf53a32918b14c4ea0601ed5fcdbdb90b1"}, +] + [[package]] name = "mistune" version = "3.0.2" @@ -4204,4 +4224,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = ">=3.10,<3.13" -content-hash = "457afc74d3de63752cf0e1b1097bd0fda380ecb2c0d07491ea071f6190200d8a" +content-hash = "fe9a1f582e87b17938bdfac09886926f5b51d42eb3d516f7f6214886932a0a6b" diff --git a/pyproject.toml b/pyproject.toml index 4c91cd58c..d257efc84 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,6 @@ python = ">=3.10,<3.13" [tool.poetry.dev-dependencies] -black = "^22.3.0" eventlet = "^0.33.3" flake8 = "^3.8.3" matplotlib = "^3.4.3" @@ -33,6 +32,11 @@ gitpython = "^3.1.31" plotly = "^5.14.1" pygithub = "^1.58.1" + +[tool.poetry.group.lint.dependencies] +micropython-uncrustify = "^1.0.0.post1" +black = "^22.3.0" + [build-system] requires = ["poetry>=0.12"] build-backend = "poetry.masonry.api"