[rocprof-compute] updated formatting workflow and docs (#348)
* updated formatting workflow and docs * restored requirements.txt
This commit is contained in:
zatwierdzone przez
GitHub
rodzic
3fd8af5974
commit
2936a468aa
@@ -30,14 +30,26 @@ jobs:
|
||||
working-directory: projects/rocprofiler-compute
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install black isort
|
||||
python -m pip install ruff
|
||||
if [ -f requirements.txt ]; then python -m pip install -r requirements.txt; fi
|
||||
- name: Run black formatter
|
||||
working-directory: projects/rocprofiler-compute
|
||||
run: black .
|
||||
- name: Run isort formatter
|
||||
working-directory: projects/rocprofiler-compute
|
||||
run: isort .
|
||||
- name: Run Ruff Linter and Import Sorter
|
||||
run: |
|
||||
ruff check . --fix --exit-zero
|
||||
- name: Run Ruff Formatter
|
||||
run: |
|
||||
ruff format .
|
||||
- name: Check for formatting/linting changes
|
||||
run: |
|
||||
git config --global user.name 'github-actions'
|
||||
git config --global user.email 'github-actions@github.com'
|
||||
git add -A .
|
||||
if ! git diff --cached --quiet; then
|
||||
echo "::error::Files were modified by ruff. Please run 'ruff check . --fix && ruff format .' locally and commit the changes."
|
||||
git diff --cached --patch # Show the diff in the logs
|
||||
exit 1
|
||||
else
|
||||
echo "Ruff found no issues or all issues were fixed and files are clean."
|
||||
fi
|
||||
|
||||
cmake:
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
Reference in New Issue
Block a user