rework formatting with cmake-format (#4627)

* merge clangify and cmakify into format.sh

update desktop lint workflow to 22.04

print cmake-format version as well

um, rename things?

add extra examples to format.sh --help
add option to not run clang-format
fix version display in .ci/lint_cpp.sh
fix relative paths in format.sh

fix formatting dirs

* run ./format.sh --cmake --branch ""

* revert formatting of cmake comments
This commit is contained in:
ebbit1q 2022-06-09 03:14:26 +02:00 committed by GitHub
parent b79506fbcf
commit 28aa473362
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 238 additions and 136 deletions

View file

@ -41,8 +41,8 @@ albeit slightly less active.
We use a separate job on the CI to check your code for formatting issues. If
your pull request failed the test, you can check the output on the checks tab.
It's the first job called "linter", you can click the "Run clangify" step to
see the output of the test.
It's the first job called "linter", you can click the "Check code formatting"
step to see the output of the test.
The message will look like this:
```
@ -50,7 +50,7 @@ The message will look like this:
*** ***
*** Your code does not comply with our style guide. ***
*** ***
*** Please correct it or run the "clangify.sh" script. ***
*** Please correct it or run the "format.sh" script. ***
*** Then commit and push those changes to this branch. ***
*** Check our CONTRIBUTING.md file for more details. ***
*** ***
@ -81,9 +81,9 @@ The handy tool `clang-format` can format your code for you, it is available for
almost any environment. A special `.clang-format` configuration file is
included in the project and is used to format your code.
We've also included a bash script, `clangify.sh`, that will use clang-format to
format all files in your pr in one go. Use `./clangify.sh --help` to show a
full help page.
We've also included a bash script, `format.sh`, that will use clang-format to
format all files in your pr in one go. Use `./format.sh --help` to show a full
help page.
To run clang-format on a single source file simply use the command
`clang-format -i <filename>` to format it in place. (Some systems install

View file

@ -8,8 +8,8 @@ on:
- '.github/workflows/web-*.yml'
jobs:
clang-format:
runs-on: ubuntu-latest
format:
runs-on: ubuntu-22.04
steps:
- name: Checkout
@ -17,12 +17,12 @@ jobs:
with:
fetch-depth: 20 # should be enough to find merge base
- name: Install clang-format
- name: Install dependencies
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends clang-format
sudo apt-get install -y --no-install-recommends clang-format cmake-format
- name: Run clangify
- name: Check code formatting
shell: bash
run: ./.ci/lint_cpp.sh