Skip to content

Commit

Permalink
[Docs][Scripts] Update 'clang-format'-related descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
dnhsieh-intel committed Oct 23, 2024
1 parent e9caa17 commit 64f17b4
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
1 change: 0 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Fixes # (GitHub issue)
## All Submissions

- [ ] Do all unit tests pass locally? Attach a log.
- [ ] Have you formatted the code using clang-format?

## New interfaces

Expand Down
11 changes: 10 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,16 @@ The general principle is to follow the style of existing/surrounding code. If yo
```sh
clang-format -style=file -i foo.cpp
```
This formats code using the `_clang_format` file found in the oneMKL top-level directory.
This formats code using the `_clang_format` file found in the oneMKL top-level directory. The version of `clang-format` is specified in [`.pre-commit-config.yaml`](https://github.com/oneapi-src/oneMKL/blob/develop/.pre-commit-config.yaml). Alternatively, you can install and run `pre-commit`, which will install the specified `clang-format` version automatically:
```sh
python3 -m venv <venv-name>
source <venv-name>/bin/activate
pip install pre-commit
cd <path-to-onemkl>
pre-commit run --all-files
deactivate
```
By default, `pre-commit` caches data in `~/.cache/pre-commit`. You can set `PRE_COMMIT_HOME` to use another location.


### GN: General Naming
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_backend_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def usage(err = None):
print('error: %s' % err)
print('''\
Script to generate backend library header based on base_header.h
Note: requires clang-format 9.0.0 tool to be installed
Note: requires clang-format tool to be installed
Usage:
{script} <path/to/base_header.hpp> <path/to/backend_include.hpp> <namespace>
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_ct_instant.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def usage(err = None):
print('error: %s' % err)
print('''\
Script to generate CT API instantiations for backend based on general_ct_templates.hpp
Note: requires clang-format 9.0.0 tool to be installed
Note: requires clang-format tool to be installed
Usage:
{script} <path/to/general_ct_templates.hpp> <path/to/out_ct_header.hpp> <path/to/backend_include.hpp> <backend> <namespace>
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_ct_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def usage(err = None):
print('error: %s' % err)
print('''\
Script to generate header file for templated compile-time API based on base_header.h
Note: requires clang-format 9.0.0 tool to be installed
Note: requires clang-format tool to be installed
Usage:
{script} <path/to/base_header.hpp> <path/to/out_headername.hpp>
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def usage(err = None):
print('error: %s' % err)
print('''\
Script to generate blank wrappers and pointers table based on header.hpp
Note: requires clang-format 9.0.0 tool
Note: requires clang-format tool
Usage:
{script} <path/to/header.hpp> <path/to/table.hpp> <path/to/out_wrappers.cpp> <libname>
Expand Down

0 comments on commit 64f17b4

Please sign in to comment.