diff --git a/contributing.md b/contributing.md index f6e55c40d..2bdad7e35 100644 --- a/contributing.md +++ b/contributing.md @@ -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 @@ -45,7 +45,28 @@ 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 Windows drivers + ```bash + bash Tools/clang-format-helper.sh '.' '' './VirtIO' + ``` + - For VirtIO library + ```bash + bash Tools/clang-format-helper.sh 'VirtIO' '' '' + ``` +* **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)