Files
OpenVR-AdvancedSettings-frame/docs/CONTRIBUTING.md
T
Vasily 3a6c8f5b11 Add documentation for use of clang-format
A CONTRIBUTING file is considered special by Github, being automatically
linked to whenever an attempted pull request is made. Writing the
formatting changes along with how to submit bug reports might seem
fractured, but the special status of the CONTRIBUTING file means that
users are likely to find it. Additionally, links will be added to the
Readme and building_on_windows files.
2018-12-28 15:53:49 +01:00

3.5 KiB

How to contribute to OpenVR Advanced Settings

You found a bug or have a suggestion for improvement

First, look through the issues page and see if there are any open issues relevant to yours. If there are, describe your issue in detail and why you think it's relevant to the already open issue.

If there aren't any open issues relevant to yours, create a new issue and give as much detail as possible.

For bug reports include what you expect to happen, what happened, version number of the application, operating system, SteamVR version number (if possible) and any other information you find relevant.

For improvement requests include what you're expecting to do, why you want the feature this way, the problem that you're solving and any other information that you find relevant.

Include logs if possible. Logs can be found in %APPDATA%\matzman666\OpenVRAdvancedSettings\AdvancedSettings.log on Windows.

You want to submit changes

Building

If you haven't already, read the instructions for how to build on Windows or Linux. Your patch must build on all platforms without errors (warnings are treated as errors). Notice that different compilers have different warning messages, being able to successfully compile on one does not mean that all of them will pass. The pull request will be built on both Windows (msvc) and Linux (gcc and clang) CI servers.

Formatting

This project uses clang-format (part of the LLVM collection) on all *.cppand *.h files in the src directory, using the supplied .clang-format file in the root of the repository. Correct formatting is checked by the CI servers.

The .\build_scripts\win\format.cmd (for Windows) and ./build_scripts/linux/format (for Linux) scripts will automatically run clang-format on all required files.

The Windows script requires that either your clang-format.exe is in C:\Program Files\LLVM\bin\clang-format.exe or the CLANG_FORMAT_LOC environment variable is set to the location of the .exe.

The Linux script requires that clang-format is in your path.

There are clang-format plugins for many IDEs, including Qt Creator and Visual Studio.

To verify that your patch has been formatted correctly, run .\build_scripts\win\verify_formatting.cmd on Windows or ./build_scripts/linux/verify_formatting on Linux. If there are formatting changes needed the script will output a diff showing which changes are needed, otherwise it will output FORMATTED CORRECTLY.. The verification script requires python in the path for Linux and Windows. On Windows the verification script will either use the CLANG_FORMAT_LOC environment variable or the default location.

Style guide

Currently, there are no directives for style other than clang-format.