diff options
| author | Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> | 2020-07-29 21:12:06 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-29 21:12:06 -0700 |
| commit | d367c4c0b8ab65278f6e9e1b21641753a6273882 (patch) | |
| tree | 009e5615923f4d3aee40293189e9eb5df7ca4789 /docs | |
| parent | b93fa7a1b44a9290b9bdbb8ee7419cbda6fc20fa (diff) | |
| download | vcpkg-d367c4c0b8ab65278f6e9e1b21641753a6273882.tar.gz vcpkg-d367c4c0b8ab65278f6e9e1b21641753a6273882.zip | |
[vcpkg] Improve format check failure message (#12460)
* [docs] Add format document
* improve the error message
* Check the error message
* Finish test
* restore file list
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/maintainers/maintainer-guide.md | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/docs/maintainers/maintainer-guide.md b/docs/maintainers/maintainer-guide.md index 0b6532258..e0fde7e68 100644 --- a/docs/maintainers/maintainer-guide.md +++ b/docs/maintainers/maintainer-guide.md @@ -208,6 +208,34 @@ Note that if a library generates CMake integration files (`foo-config.cmake`), r Finally, DLL files on Windows should never be renamed post-build because it breaks the generated LIBs.
+## Code format
+
+### Vcpkg internal code
+
+We require the c/c++ code inside vcpkg to follow the clang-format, if you change them. Please perform the following steps after modification:
+
+- Use Visual Studio:
+1. Configure your [clang-format tools](https://devblogs.microsoft.com/cppblog/clangformat-support-in-visual-studio-2017-15-7-preview-1/).
+2. Open the modified file.
+3. Use shortcut keys Ctrl+K, Ctrl+D to format the current file.
+
+- Use tools:
+1. Install [llvm clang-format](https://releases.llvm.org/download.html#10.0.0)
+2. Run command:
+```cmd
+> LLVM_PATH/bin/clang-format.exe -style=file -i changed_file.cpp
+```
+
+### Manifest
+
+We require that the manifest file needs to be formatted, perform the following steps to solve this issue:
+
+1. Format all changed manifest files.
+```cmd
+> vcpkg x-format-manifest --all
+```
+2. Commit changes to your branch.
+
## Useful implementation notes
### Portfiles are run in Script Mode
|
