From 11090441fdf030939a9e17fec6fc782a40e2bee2 Mon Sep 17 00:00:00 2001 From: Roland Kaminski Date: Wed, 11 Dec 2024 12:41:37 +0100 Subject: [PATCH] add a pre-commit config with basic formatters - the formatters have not been applied yet - clang-format will produce some mess up due to folding comments --- .clang-format | 5 +++++ .pre-commit-config.yaml | 28 ++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 .clang-format create mode 100644 .pre-commit-config.yaml diff --git a/.clang-format b/.clang-format new file mode 100644 index 000000000..0aa04f6a3 --- /dev/null +++ b/.clang-format @@ -0,0 +1,5 @@ +--- +IndentWidth: '4' +ColumnLimit: '120' +IndentCaseLabels: 'true' +... diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..6fb9c1571 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,28 @@ +fail_fast: true +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 + hooks: + - id: end-of-file-fixer + - id: trailing-whitespace + exclude: ^.github/ + + - repo: https://github.com/pycqa/isort + rev: 5.13.2 + hooks: + - id: isort + args: ["--profile", "black"] + exclude: ^.github/ + + - repo: https://github.com/psf/black + rev: 24.4.0 + hooks: + - id: black + exclude: ^.github/ + + - repo: https://github.com/pre-commit/mirrors-clang-format + rev: v18.1.8 + hooks: + - id: clang-format + exclude: /_clingo\.c$ + types_or: [c++, c, cuda]