alibaba--zvec
7ca09fcf54
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v6...v7) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
53 行
1.3 KiB
YAML
53 行
1.3 KiB
YAML
name: Lint
|
|
|
|
on:
|
|
workflow_call:
|
|
|
|
jobs:
|
|
lint:
|
|
name: Code Quality Checks
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: '3.10'
|
|
cache: 'pip'
|
|
cache-dependency-path: 'pyproject.toml'
|
|
|
|
- name: Install linting tools
|
|
run: |
|
|
python -m pip install --upgrade pip \
|
|
ruff==v0.14.4 \
|
|
clang-format==18.1.8
|
|
shell: bash
|
|
|
|
- name: Run Ruff Linter
|
|
run: python -m ruff check .
|
|
shell: bash
|
|
|
|
- name: Run Ruff Formatter Check
|
|
run: python -m ruff format --check .
|
|
shell: bash
|
|
|
|
- name: Run clang-format Check
|
|
run: |
|
|
CPP_FILES=$(find . -type f \( -name "*.cpp" -o -name "*.h" -o -name "*.hpp" -o -name "*.cc" -o -name "*.cxx" \) \
|
|
! -path "./build/*" \
|
|
! -path "./tests/*" \
|
|
! -path "./scripts/*" \
|
|
! -path "./python/*" \
|
|
! -path "./thirdparty/*" \
|
|
! -path "./.git/*")
|
|
|
|
if [ -z "$CPP_FILES" ]; then
|
|
echo "No C++ files found to check."
|
|
exit 0
|
|
fi
|
|
|
|
clang-format --dry-run --Werror $CPP_FILES
|
|
shell: bash
|