Skip to content

Commit

Permalink
README: add clang-format action workflow instructions
Browse files Browse the repository at this point in the history
Explains how to run and apply action workflow locally to avoid
breaking style.

Also minor README changes.

Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
  • Loading branch information
wipawel committed Aug 17, 2020
1 parent d3f5f39 commit c2d74ae
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ make debug
#### Xen guest

Use the following guest domain config example for booting KTF with Xen:
```
```python
name="kernel64"
builder="hvm"
memory=1024
Expand All @@ -115,12 +115,33 @@ The style for this project is defined in `.clang-format` file in the main direct

Use the following command to apply the style automatically to the file you modify:

```
```bash
clang-format -style=file -Werror -i MODIFIED_FILE
```

For more information refer to: https://clang.llvm.org/docs/ClangFormat.html

This project uses https://github.com/DoozyX/clang-format-lint-action action workflow to detect style mismatches automatically.
For more information refer to: https://github.com/marketplace/actions/clang-format-lint

### Running the clang-format workflow locally

#### Build `clang-format-lint` container

```bash
docker build -t clang-format-lint github.com/DoozyX/clang-format-lint-action
```

This has to be done only once.

#### Patch your files

```bash
for ext in c h; do
docker run --rm --workdir /src -v $(pwd):/src clang-format-lint --clang-format-executable /clang-format/clang-format10 -r --exclude .git $(find . -name \*.$ext -print) | patch -p1
done
```

## Credits and Attributions

* Parts of the KTF project are inspired by and based on XTF project [1] developed by Andrew Cooper of Citrix.
Expand Down

0 comments on commit c2d74ae

Please sign in to comment.