Wykres commitów

6 Commity (cee0945f1c34d27db7f7a166be8ca8ea39f5349d)

Autor SHA1 Wiadomość Data
Jim Mussared cee0945f1c 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 <jim.mussared@gmail.com>
2023-12-20 11:56:24 +11:00
Jim Mussared efa0402846 tools/codeformat.py: Fix ruff warnings.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-07-27 12:28:29 +10:00
Jim Mussared 232859250c tools/codeformat.py: Remove git state detection.
This was added to speed up running codeformat.py when only a small number
of files are changed, but it breaks running the tool on the master branch.
The pre-commit tool handles this correctly, and it's working well in the
main repo, so we can remove the special handling.

This makes codeformat.py behave identically to the main repository, but
without additional code for handling .c/.h files.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-07-27 12:26:08 +10:00
Andrew Leech 22cd7fdd64 tools/codeformat: Fix compatibility running from subfolder in repo. 2022-03-23 12:16:24 +11:00
Andrew Leech ab1e6231dc tools/codeformat: By default only check/update on current git branch.
It can be difficult using the codeformat.py tool when there are other files
in the repository not currently matching the standard.

For developers, running over the entire repo can throw up a large list of
changes in a local git which can lead to inclusion of unrelated changes in
commits if they're added accidentally.  If the files arg is used to trim
down the list of files scanned, it runs a risk of missing some files
they've modified.  In CI, it means that PR's can fail on codeformat for
issues that aren't related to that PR.

This change adds a git query in the codeformat tool by default to only work
on the list of files that have been modified in the current branch.  This
can still be overridden by the files arg to run over all files still, eg.
python3 tools/codeformat.py -v '**'.
2022-03-22 16:46:48 +11:00
Damien George d093a684a4 tools: Add code formatting and CI scripts.
Adapted from the micropython repo.

Signed-off-by: Damien George <damien@micropython.org>
2021-05-27 22:42:36 +10:00