Skip to content

Lines-changed-only seems not to work for clang-tidy #297

@regit

Description

@regit

What events trigger your workflow?

on:
  pull_request:
    branches: [master]
    paths: ['**.c', '**.h', '**.am']
  push:
    paths: ['**.c', '**.h', '**.am']

What OS does your workflow use?

runs-on: ubuntu-latest
container: ubuntu:22.04

How is cpp-linter-action configured?

- uses: cpp-linter/cpp-linter-action@v2
        id: linter
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          style: '' # Empty for no format check
          tidy-checks: '' # Use .clang-tidy config file. 
          version: ${{ env.LLVM_VERSION }}
          # only 'update' a single comment in a pull request's thread. 
          thread-comments: ${{ github.event_name == 'pull_request' && 'update' }}
          lines-changed-only: true
          tidy-review: true
          passive-reviews: true

What was the unexpected behavior?

I'm testing the action and it seems to detect correctly the line changed in the file I did update to trigger some error.

The job is running the command:

/usr/bin/clang-tidy-14 --line-filter=[{"name": "src/source-af-packet.c", "lines": [[1, 2], [932, 935], [940, 943]]}] --extra-arg= --fix-errors src/source-af-packet.c

which returns no warning despite the introduction of invalid code in these places.

When I run a derivated same command on my system:

clang-tidy --line-filter='[{"name": "src/source-af-packet.c", "lines": [[1, 2], [932, 935], [940, 943]]}]' --extra-arg= src/source-af-packet.c

I got no error too but if I do

clang-tidy --line-filter='[{"name": "source-af-packet.c", "lines": [[1, 2], [932, 935], [940, 943]]}]' --extra-arg= src/source-af-packet.c

then I got the correct behavior.

Is there an option to skip the source directory in the action ?

Failing job url: https://github.com/regit/suricata/actions/runs/14709331910/job/41277429460

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions