Skip to content

Commit

Permalink
Document the formatting script.
Browse files Browse the repository at this point in the history
  • Loading branch information
1uc committed Nov 2, 2024
1 parent 46f6a0c commit 21da856
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion bin/format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ venv_dir="$script_dir/../.clang-format-venv"
if [ ! -d "$venv_dir" ]; then
python3 -m venv "$venv_dir"
source "$venv_dir/bin/activate"
pip install clang-format==14.0.0
pip install clang-format==12.0.1
deactivate
fi

Expand Down
18 changes: 6 additions & 12 deletions doc/developer_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,16 @@ tests.
### Code formatting
The project is formatted using clang-format version 12.0.1 and CI will complain
if a commit isn't formatted accordingly. The `.clang-format` is at the root of
the git repository. Conveniently, `clang-format` is available via `pip`:
the git repository. Conveniently, `clang-format` is available via `pip`.

Formatting the entire code base can be done with:
```bash
python -m venv venv
source venv/bin/activate

pip install clang-format==12.0.1
bin/format.sh
```
which will install the required version of clang-format in a venv called
`.clang-format-venv`.

The changed lines can be formatted with `git-clang-format`, e.g. to format all lines changed compared to master:

```bash
git-clang-format master
```
(add `-f` to allow formatting unstaged changes if you trust it to not destroy
your changes.)
To format only the changed files `git-clang-format` can be used.

## Releasing HighFive
Before releasing a new version perform the following:
Expand Down

0 comments on commit 21da856

Please sign in to comment.