Skip to content

Add -style file:<path> option #156

@mrousavy

Description

@mrousavy

Hey! Thanks for your package.

I'm trying to use it in a project where my code is in a subdirectory:

- .github/
- README.md
- package/
    - cpp/.clang-format
    - cpp/...
    - package.json

I couldn't figure out how to properly configure the github action to use the .clang-format file in that directory. Here's my workflow:

jobs:
  lint:
    name: Check clang-format
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: ./package
    strategy:
      matrix:
        path:
          - 'cpp'
          - 'android/src/main/cpp'
          - 'ios'
    steps:
      - uses: actions/checkout@v2
      - name: Run clang-format style check
        uses: jidicula/[email protected]
        with:
          clang-format-version: '16'
          check-path: ${{ matrix.path }}
          fallback-style: file:./package/cpp/.clang-format

Any thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions