Skip to content

Commit

Permalink
Document format_precice_config.py
Browse files Browse the repository at this point in the history
  • Loading branch information
MakisH authored Dec 15, 2022
1 parent 4b18e4f commit 4c7ac2c
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions pages/docs/dev-docs/dev-tooling.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ To keep the code-base consistent, please use `clang-format` version 8.
Scripts will explicitly use `clang-format-8` to prevent any problems.
Looking for precompiled binaries? Here is the [official APT repository](http://apt.llvm.org/).

We also use a custom formatting tool for XML files based on python 3 and the lxml package. So make sure to install it e.g. via `pip install --user lxml`.

To format the entire codebase, run our formatting tool:

```bash
Expand Down Expand Up @@ -73,6 +71,24 @@ void formatted_code_again;
void formatted_code_yet_again;
```

## Formatting preCICE configuration files

To format your `precice-config.xml`, you can use the script `format_precice_config.py` which is part of the [preCICE pre-commit hooks](https://github.com/precice/precice-pre-commit-hooks) (without needing to install the pre-commit hooks) and depends on the lxml package (install it with `pip install --user lxml`). To format a file in place:

```bash
format_precice_config.py precice-config.xml
```

The script returns 0 on success, 1 on error, and 2 if a file was modified.

You may want to define an alias for convenience:

```bash
function preciceConfigFormat(){
/path/to/format_precice_config.py "${1:-precice-config.xml}"
}
```

## clang-tidy

The tool `clang-tidy` runs static analysis on C and C++ files and reports warnings in clang error format (i.e. editors can parse them).
Expand Down

0 comments on commit 4c7ac2c

Please sign in to comment.