Skip to content

[Code Analysis] Lint code #7988

[Code Analysis] Lint code

[Code Analysis] Lint code #7988

Workflow file for this run

---
# SPDX-FileCopyrightText: (C) 2025 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
name: "[Code Analysis] Lint code"
run-name: "[Code Analysis] Lint code"
on: # yamllint disable-line rule:truthy
pull_request:
branches:
- main
- release-*
workflow_dispatch: {}
permissions:
contents: read # needed for actions/checkout
jobs:
required-linters:
name: "Run required linters"
runs-on: ubuntu-latest
steps:
- name: "Checkout code"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: "Setup environment"
uses: open-edge-platform/orch-ci/.github/actions/bootstrap@14aa8ce3d0a5455574fc7fce7d90b2d18636c68e # 0.1.40
with:
bootstrap_tools: "base"
- name: "Install prettier tool"
run: |
npm install --save-dev prettier prettier-plugin-jinja-template
- name: "Install GHA linter"
run: |
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) 1.7.7
- name: "Run prettier check"
if: always()
run: |
make prettier-check
- name: "Run GHA linter"
if: always()
run: |
./actionlint --config-file .github/resources/actionlint.yaml
- name: "Check python indent"
if: always()
run: |
make indent-check
optional-linters:
name: "Run optional linters"
runs-on: ubuntu-latest
steps:
- name: "Checkout code"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: "Setup environment"
uses: open-edge-platform/orch-ci/.github/actions/bootstrap@14aa8ce3d0a5455574fc7fce7d90b2d18636c68e # 0.1.40
with:
bootstrap_tools: "base,python,shellcheck,hadolint,"
- name: "Install python linters"
run: |
pip install -r .github/resources/requirements.txt
- name: "Install Javascript linter and prettier tool"
run: |
npm install --save-dev eslint@latest @eslint/js@latest
- name: "Install cpp linter"
run: |
pipx install cpplint
- name: "Run Python linter - pylint"
if: always()
continue-on-error: true
run: |
make lint-python-pylint
- name: "Run Python linter - flake8"
if: always()
continue-on-error: true
run: |
make lint-python-flake8
- name: "Run JavaScript linter"
if: always()
continue-on-error: true
run: |
make lint-javascript
- name: "Run C++ linter"
if: always()
continue-on-error: true
run: |
make lint-cpp
- name: "Run shell linter - shellcheck"
if: always()
continue-on-error: true
run: |
make lint-shell
- name: "Run dockerfiles linter"
if: always()
continue-on-error: true
run: |
make lint-dockerfiles