Skip to content

Enable clang-tidy and Ruff linting in Github Actions #10781

Enable clang-tidy and Ruff linting in Github Actions

Enable clang-tidy and Ruff linting in Github Actions #10781

Workflow file for this run

name: Format Check
on:
push:
branches:
- "community"
pull_request:
branches:
- "community"
- "release/**"
merge_group:
workflow_dispatch:
jobs:
formatting-check:
name: Formatting Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run clang-format style check for C/C++ code
uses: d-griet/clang-format-lint-action@99a106be2f3f1a92d9783ea7c744fde62d8ce1fa
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
source: "./src"
extensions: "c,cpp,h,hpp"
clangFormatVersion: 19
- name: Run Ruff format check for Python code
uses: astral-sh/ruff-action@v3
with:
args: "format --check"
src: "./scripts/ ./contrib ./tests ./src"
- name: Run Ruff lint check for Python code
uses: astral-sh/ruff-action@v3
with:
src: "./scripts/ ./contrib ./tests ./src"
- name: Run clang-tidy check for C/C++ code
uses: ZedThree/[email protected]
id: review
with:
token: ${{ secrets.GITHUB_TOKEN }}
apt_packages: curl, git
clang_tidy_version: 19
config_file: .clang-tidy
lgtm_comment_body: ""
build_dir: build
cmake_command: ./dbt configure
# If there are any comments, fail the check
- if: steps.review.outputs.total_comments > 0
run: exit 1