Skip to content

Commit

Permalink
RHEL-65784: Update code style section in contributing.md
Browse files Browse the repository at this point in the history
Jira: https://issues.redhat.com/browse/RHEL-65784

Signed-off-by: Konstantin Kostiuk <[email protected]>
  • Loading branch information
kostyanf14 authored and YanVugenfirer committed Nov 27, 2024
1 parent d93a234 commit c82153a
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ We use GitHub issues to track public bugs. Report a bug by [opening a new issue]

- A quick summary and/or background
- Steps to reproduce
  - Be specific!
  - Give sample code if you can.
- Be specific!
- Give sample code if you can.
- Driver version or commit hash that was used to build the driver
- QEMU command line
- What you expected would happen
Expand All @@ -45,7 +45,36 @@ We use GitHub issues to track public bugs. Report a bug by [opening a new issue]
People *love* thorough bug reports.

## Use a Consistent Coding Style
* 4 spaces for indentation rather than tabs

* We use clang-format tool to check code style.
* In project we have two different code style:
- Style config file for Windows driver /.clang-format
- Style config file for VirtIO library /VirtIO/.clang-format
* To run code style check locally on Linux or Windows (with MSYS or cygwin) use `Tools/clang-format-helper.sh` helper
- on Linux helper uses `clang-format` from PATH
- on Windows helper uses `clang-format` from EWDK 24H2
- CLI:
- For all Windows drivers
```bash
bash Tools/clang-format-helper.sh '.' '' './VirtIO'
```
- For VirtIO library
```bash
bash Tools/clang-format-helper.sh 'VirtIO' '' ''
```
* Tools/clang-format-helper.sh uses positional arguments
1. Directory where needs to check format
1. Path to .clang-format file (default: `${1}/.clang-format`)
1. Exclude regexp (default: `^$`)
1. Include regexp (default: `^.*\.((((c|C)(c|pp|xx|\+\+)?$)|((h|H)h?(pp|xx|\+\+)?$)))$`)

- To use default just put '' as argument

* **NOTE**

On Windows clang-format reports problem with several files but changes that needs to be done are not detected by git.

We are investigating this issue.

## HCK\HLK tests
* The contributions should pass Microsoft certification tests. We are running CI to check that the changes in the pull request can pass. If you submit a lot of PRs, you can setup AutoHCK on your premises to test your code changes: [auto-hck setup](https://github.com/HCK-CI/HCK-CI-DOCS/blob/master/installing-hck-ci-from-scratch.txt)
Expand Down

0 comments on commit c82153a

Please sign in to comment.