
This introduces clang-format to enforce a consistent code style for Stockfish. Having a documented and consistent style across the code will make contributing easier for new developers, and will make larger changes to the codebase easier to make. To facilitate formatting, this PR includes a Makefile target (`make format`) to format the code, this requires clang-format (version 17 currently) to be installed locally. Installing clang-format is straightforward on most OS and distros (e.g. with https://apt.llvm.org/, brew install clang-format, etc), as this is part of quite commonly used suite of tools and compilers (llvm / clang). Additionally, a CI action is present that will verify if the code requires formatting, and comment on the PR as needed. Initially, correct formatting is not required, it will be done by maintainers as part of the merge or in later commits, but obviously this is encouraged. fixes https://github.com/official-stockfish/Stockfish/issues/3608 closes https://github.com/official-stockfish/Stockfish/pull/4790 Co-Authored-By: Joost VandeVondele <Joost.VandeVondele@gmail.com>
3.4 KiB
Contributing to Stockfish
Welcome to the Stockfish project! We are excited that you are interested in contributing. This document outlines the guidelines and steps to follow when making contributions to Stockfish.
Table of Contents
Building Stockfish
In case you do not have a C++ compiler installed, you can follow the instructions from our wiki.
Making Contributions
Reporting Issues
If you find a bug, please open an issue on the issue tracker. Be sure to include relevant information like your operating system, build environment, and a detailed description of the problem.
Please note that Stockfish's development is not focused on adding new features. Thus any issue regarding missing features will potentially be closed without further discussion.
Submitting Pull Requests
-
Functional changes need to be tested on fishtest. See Creating my First Test for more details. The accompanying pull request should include a link to the test results and the new bench.
-
Non-functional changes (e.g. refactoring, code style, documentation) do not need to be tested on fishtest, unless they might impact performance.
-
Provide a clear and concise description of the changes in the pull request description.
First time contributors should add their name to AUTHORS.
Stockfish's development is not focused on adding new features. Thus any pull request introducing new features will potentially be closed without further discussion.
Code Style
Changes to Stockfish C++ code should respect our coding style defined by
.clang-format. You can format your changes by running
make format
. This requires clang-format version 17 to be installed on your system.
Community and Communication
- Join the Stockfish discord to discuss ideas, issues, and development.
- Participate in the Stockfish GitHub discussions for broader conversations.
License
By contributing to Stockfish, you agree that your contributions will be licensed under the GNU General Public License v3.0. See Copying.txt for more details.
Thank you for contributing to Stockfish and helping us make it even better!