forked from micropython/micropython-lib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
all: Replace "black" with "ruff format".
- Add config for [tool.ruff.format] to pyproject.toml. - Update pre-commit to run both ruff and ruff-format. - Update a small number of files that change with ruff's rules. - Update CI. - Simplify codeformat.py just forward directly to "ruff format" This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <[email protected]>
- Loading branch information
Showing
9 changed files
with
20 additions
and
119 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | ||
name: Python code lint with ruff | ||
name: Python code lint and formatting with ruff | ||
on: [push, pull_request] | ||
jobs: | ||
ruff: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: pip install --user ruff==0.1.0 | ||
- run: pip install --user ruff==0.1.2 | ||
- run: ruff check --output-format=github . | ||
- run: ruff format --diff . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,14 @@ | ||
repos: | ||
- repo: local | ||
hooks: | ||
- id: codeformat | ||
name: MicroPython codeformat.py for changed files | ||
entry: tools/codeformat.py -v -f | ||
language: python | ||
- id: verifygitlog | ||
name: MicroPython git commit message format checker | ||
entry: tools/verifygitlog.py --check-file --ignore-rebase | ||
language: python | ||
verbose: true | ||
stages: [commit-msg] | ||
- repo: https://github.com/charliermarsh/ruff-pre-commit | ||
rev: v0.1.0 | ||
rev: v0.1.2 | ||
hooks: | ||
- id: ruff | ||
id: ruff-format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters