mirror of
https://github.com/ModOrganizer2/check-formatting-action.git
synced 2026-07-27 14:08:58 -07:00
Initial commit.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2023 ModOrganizer 2 Team
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
@@ -0,0 +1,29 @@
|
||||
# Check code formatting for ModOrganizer repositories
|
||||
|
||||
Action to check code formatting for ModOrganizer 2 components within Github workflows.
|
||||
|
||||
**Example usage**:
|
||||
|
||||
```yml
|
||||
name: Lint Mob
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Check format
|
||||
uses: ModOrganizer2/check-formatting-action@master
|
||||
with:
|
||||
check-path: "."
|
||||
exclude-regex: "third-party"
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
See https://github.com/jidicula/clang-format-action.
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
name: ModOrganizer2 code formatting check
|
||||
description: Check code formatting for ModOrganizer 2 plugins
|
||||
|
||||
inputs:
|
||||
check-path:
|
||||
description: 'The path to the directory you want to check for correct C/C++/Protobuf formatting. Default is the full repository.'
|
||||
required: false
|
||||
default: '.'
|
||||
exclude-regex:
|
||||
description: 'A regex to exclude files or directories that should not be checked. Default is empty.'
|
||||
required: false
|
||||
default: ''
|
||||
fallback-style:
|
||||
description: 'The fallback style for clang-format if no .clang-format file exists in your repository.'
|
||||
required: false
|
||||
default: 'llvm'
|
||||
include-regex:
|
||||
description: 'A regex to override the C/C++/Protobuf/CUDA filetype regex. that should be checked. Default results in the regex defined in `check.sh`.'
|
||||
required: false
|
||||
default: ''
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Run clang-format
|
||||
uses: jidicula/clang-format-action@v4.11.0
|
||||
with:
|
||||
clang-format-version: "17"
|
||||
check-path: ${{ inputs.check-path }}
|
||||
exclude-regex: ${{ inputs.exclude-regex }}
|
||||
fallback-style: ${{ inputs.fallback-style }}
|
||||
include-regex: ${{ inputs.include-regex }}
|
||||
Reference in New Issue
Block a user