Skip to content

Commit

Permalink
pyproject: use micropython-uncrustify
Browse files Browse the repository at this point in the history
This switches to using micropython-uncrustify instead of the distro
package. Upstream uncrustify made breaking changes, so we need a way
to use an exact version, which is provided by micropython-uncrustify.

Also move black to the new lint group, since it is a linter and update
the github action accordingly.
  • Loading branch information
dlech committed Aug 11, 2024
1 parent 83afe2c commit b7427f0
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 16 deletions.
19 changes: 5 additions & 14 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
22 changes: 21 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"

0 comments on commit b7427f0

Please sign in to comment.