Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TEST: touch python file #771

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ jobs:
needs: find-changed-files
if: ${{ needs.find-changed-files.outputs.files != '[]' }}
runs-on: ubuntu-latest
# Allow the workflow run to pass when this job fails
continue-on-error: true
strategy:
fail-fast: false
matrix:
Expand All @@ -55,12 +53,17 @@ jobs:
- uses: actions/checkout@v4

- name: Run ruff format check for ${{ matrix.files.path }}
id: format-check
uses: astral-sh/ruff-action@v1
# Allow the job run to pass when this step fails
continue-on-error: true
with:
args: "format --check --diff"
src: "${{ matrix.files.path }}"
version: 0.8.1

- name: Annotate unformatted file
if: ${{ failure() }}
if: ${{ steps.format-check.outcome }} == 'failure'
run: |
echo "::warning file=${{ matrix.files.path }},title=File format check failed::Run 'ruff format ${{ matrix.files.path }}'"
JOB_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
echo "::notice file=${{ matrix.files.path }},title=Unformatted file::Consider running 'ruff format ${{ matrix.files.path }}'%0ASee $JOB_URL for more details"
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ extend-select = [
"UP", # pyupgrade
"W", # pycodestyle warnings
]
ignore = [
"UP027", # deprecated pyupgrade rule
]

[tool.ruff.format]
quote-style = "preserve"
Expand Down
1 change: 1 addition & 0 deletions src/west/app/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python3

Check notice on line 1 in src/west/app/main.py

View workflow job for this annotation

GitHub Actions / Check file src/west/app/main.py

Unformatted file

Consider running 'ruff format src/west/app/main.py' See https://github.com/zephyrproject-rtos/west/actions/runs/12135574563 for more details

# Copyright 2018 Open Source Foundries Limited.
# Copyright 2019 Foundries.io Limited.
Expand Down Expand Up @@ -1226,4 +1226,5 @@
}

if __name__ == "__main__":
# Test touching a python file
main()
1 change: 1 addition & 0 deletions src/west/app/project.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2018, 2019 Nordic Semiconductor ASA

Check notice on line 1 in src/west/app/project.py

View workflow job for this annotation

GitHub Actions / Check file src/west/app/project.py

Unformatted file

Consider running 'ruff format src/west/app/project.py' See https://github.com/zephyrproject-rtos/west/actions/runs/12135574563 for more details
# Copyright 2018, 2019 Foundries.io
#
# SPDX-License-Identifier: Apache-2.0
Expand Down Expand Up @@ -2192,6 +2192,7 @@

#
# Logging helpers
# Touch here
#


Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ deps =
types-PyYAML
flake8
mypy
ruff
ruff==0.8.1
setenv =
# For instance: ./.tox/py3/tmp/
TOXTEMPDIR={envtmpdir}
Expand Down
Loading