commit 8ee8d9c0dfc03104f2a9378ae0a88739b6914646 Author: Mikaƫl Capelle Date: Sun May 26 09:52:46 2024 +0200 Initial commit. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..04189c7 --- /dev/null +++ b/LICENSE @@ -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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..517e6a0 --- /dev/null +++ b/README.md @@ -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. diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..d3e1674 --- /dev/null +++ b/action.yml @@ -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 }}