Update container_build_publish.yml #335
Workflow file for this run
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
name: Linting | |
on: | |
push: | |
branches: '**' | |
pull_request: | |
branches: ['main', 'dev'] | |
permissions: | |
checks: write | |
contents: write | |
jobs: | |
lint: | |
name: Run linter | |
runs-on: [ 'ubuntu-latest' ] | |
env: | |
AGENT_TOOLSDIRECTORY: /home/runner/actions-runner/_work/_tool/ | |
defaults: | |
run: | |
shell: bash -el {0} | |
permissions: | |
contents: write | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12.7' | |
token: ${{ secrets.QUARK_GH_GITHUB_COM_TOKEN }} | |
- name: Install pylint and autopep8 | |
run: pip install pylint autopep8 | |
- name: Disable Git LFS locking | |
run: git config lfs.https://github.com/QUARK-framework/QUARK.git/info/lfs.locksverify false | |
- name: Run autopep8 (fix PEP8 issues automatically) | |
run: autopep8 --in-place --recursive --aggressive --max-line-length 120 -v . | |
- name: Clean the workspace | |
if: github.event_name == 'pull_request' | |
run: git reset --hard | |
- name: Commit changes if any | |
if: github.event_name == 'push' | |
run: | | |
git config --global user.name "GitHub Action" | |
git config --global user.email "[email protected]" | |
git add . | |
if git diff-index --quiet HEAD; then | |
echo "No changes to commit" | |
else | |
git commit -m "Apply autopep8 formatting" | |
git push origin HEAD:${{ github.ref }} | |
fi | |
- name: Run pylint | |
uses: wearerequired/lint-action@v2 | |
with: | |
pylint: true | |
pylint_args: "--max-line-length=120 --max-attributes=10 --max-args=8 --disable=C0111 --disable=W1514 | |
--disable=logging-fstring-interpolation --disable=import-error --disable=C0103 --disable=W0718 | |
--disable=W0719 --disable=R1705 --disable=W0107 --disable=W0613 --disable=W0401 --disable=W0614 | |
--disable=W0611 --disable=C0123 --disable=C0413 --disable=W0511 --disable=R1702 --disable=R0912 | |
--disable=R0914 --disable=R0911 --disable=R0801" | |