Commit 16feca9b authored by Samuel Jones's avatar Samuel Jones
Browse files

Implement clang-format in pre-commit

Clang-format config changes 120 column limit

Replace unknown charecter with '

Add clang-format to config.yaml

Update jenkins and .pre-commit-config.yaml to work with pre-commit
parent efc23084
BasedOnStyle: LLVM
---
BasedOnStyle: LLVM
---
Language: Cpp
ColumnLimit: 120
...
......@@ -16,4 +16,10 @@ repos:
args: ['--maxkb=4096']
- id: check-xml
- id: check-yaml
args: [--allow-multiple-documents]
- repo: https://github.com/mantidproject/pre-commit-hooks
rev: 05b2d4cfe17dcb36e29c249705364c19eeccced5
hooks:
- id: clang-format
exclude: Testing/Tools/cxxtest|tools
\ No newline at end of file
......@@ -1020,7 +1020,7 @@ yes invert the matrix using analytic formula. If not then use standard Invert
}
}
if (regular) {
// use analytic expression as described in G Y Hu and R F OConnell (1996)
// use analytic expression as described in G Y Hu and R F O'Connell (1996)
T scalefactor = numRows() > 1 ? m_rawData[1][0] : 1;
*this /= scalefactor;
T D = m_rawData[0][0];
......
......@@ -6,6 +6,12 @@
# clang-format executable
# Rely on pre-commit if clang format is in the config.yaml
if grep -F "id: clang-format" $WORKSPACE/.pre-commit-config.yaml; then
echo "Pre-commit will handle clang-format. Skipping check."
exit 0
fi
SCRIPT_DIR=$(dirname "$0")
if [[ ${JOB_NAME} == *pull_requests* ]]; then
# This relies on the fact pull requests use pull/$PR-NAME
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment