diff --git a/.clang-format b/.clang-format index c314114..b03a778 100644 --- a/.clang-format +++ b/.clang-format @@ -8,7 +8,6 @@ AlignConsecutiveAssignments: AcrossEmptyLines: false AcrossComments: false AlignCompound: false - AlignFunctionDeclarations: false AlignFunctionPointers: false PadOperators: true AlignConsecutiveBitFields: @@ -16,7 +15,6 @@ AlignConsecutiveBitFields: AcrossEmptyLines: false AcrossComments: false AlignCompound: false - AlignFunctionDeclarations: false AlignFunctionPointers: false PadOperators: false AlignConsecutiveDeclarations: @@ -24,7 +22,6 @@ AlignConsecutiveDeclarations: AcrossEmptyLines: false AcrossComments: false AlignCompound: false - AlignFunctionDeclarations: true AlignFunctionPointers: false PadOperators: false AlignConsecutiveMacros: @@ -32,21 +29,18 @@ AlignConsecutiveMacros: AcrossEmptyLines: false AcrossComments: false AlignCompound: false - AlignFunctionDeclarations: false AlignFunctionPointers: false PadOperators: false AlignConsecutiveShortCaseStatements: Enabled: false AcrossEmptyLines: false AcrossComments: false - AlignCaseArrows: false AlignCaseColons: false AlignConsecutiveTableGenBreakingDAGArgColons: Enabled: false AcrossEmptyLines: false AcrossComments: false AlignCompound: false - AlignFunctionDeclarations: false AlignFunctionPointers: false PadOperators: false AlignConsecutiveTableGenCondOperatorColons: @@ -54,7 +48,6 @@ AlignConsecutiveTableGenCondOperatorColons: AcrossEmptyLines: false AcrossComments: false AlignCompound: false - AlignFunctionDeclarations: false AlignFunctionPointers: false PadOperators: false AlignConsecutiveTableGenDefinitionColons: @@ -62,7 +55,6 @@ AlignConsecutiveTableGenDefinitionColons: AcrossEmptyLines: false AcrossComments: false AlignCompound: false - AlignFunctionDeclarations: false AlignFunctionPointers: false PadOperators: false AlignEscapedNewlines: Right diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000..7eeb788 --- /dev/null +++ b/.clang-tidy @@ -0,0 +1 @@ +Checks: '*, -clang-diagnostic-pragma-once-outside-header' diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..ae62fb4 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,33 @@ +name: Lint + +on: + pull_request: + types: [opened, synchronize] + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + + - name: Install Python linter + run: pip install ruff==0.4.4 + + - name: Run Python linter + run: ruff check . || exit 1 + + - name: Install clang-tidy + run: sudo apt-get update && sudo apt-get install -y clang-tidy + + - name: Run clang-tidy on C++ files + run: | + set -e + find . -type f \( -name '*.cpp' -o -name '*.cc' -o -name '*.h' \) \ + -exec clang-tidy {} -- -std=c++17 -xc++ -I. \; diff --git a/.github/workflows/pr-review.yml b/.github/workflows/pr-review.yml index 94ac71e..4c5a69f 100644 --- a/.github/workflows/pr-review.yml +++ b/.github/workflows/pr-review.yml @@ -26,7 +26,6 @@ jobs: env: DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }} DEEPSEEK_API_BASE: ${{ secrets.DEEPSEEK_API_BASE }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - echo "Checking GITHUB_TOKEN availability..." - echo "GITHUB_TOKEN=${GITHUB_TOKEN:0:4}***" python .github/scripts/pr-review.py