Skip to content

Commit aa53ff9

Browse files
authored
Merge pull request dealii#17893 from jpthiele/precommit
Add pre-commit config and CI job
2 parents a6611ce + 49406c7 commit aa53ff9

File tree

77 files changed

+96
-107
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+96
-107
lines changed

.github/workflows/indent.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,3 @@ jobs:
6868
with:
6969
name: doxygen_documentation
7070
path: build/doc/doxygen
71-
72-
typos:
73-
# check for typos
74-
75-
name: typos
76-
runs-on: [ubuntu-24.04]
77-
78-
steps:
79-
- uses: actions/checkout@v4
80-
- uses: crate-ci/[email protected]
81-
with:
82-
files: doc examples include source tests
83-
config: ./.typos.toml

.github/workflows/pre-commit.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: pre-commit
2+
3+
on: [push, pull_request]
4+
concurrency:
5+
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}
6+
cancel-in-progress: ${{github.event_name == 'pull_request'}}
7+
permissions:
8+
contents: read
9+
10+
env:
11+
SKIP: clang-format, no-commit-to-branch
12+
13+
jobs:
14+
pre-commit:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-python@v5
19+
- uses: pre-commit/[email protected]

.pre-commit-config.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
4+
hooks:
5+
- id: check-added-large-files
6+
args: [--maxkb=8192]
7+
- id: check-merge-conflict
8+
- id: check-json
9+
exclude: tests/a-framework/parameter_file_3\.json
10+
- id: check-toml
11+
- id: check-yaml
12+
args: [--allow-multiple-documents]
13+
- id: end-of-file-fixer
14+
exclude: |
15+
(?x)(
16+
\.output|
17+
\.run_only|
18+
\.diff|
19+
^bundled/
20+
)
21+
- id: no-commit-to-branch
22+
args: [--branch,master]
23+
- id: trailing-whitespace
24+
files: |
25+
(?x)(
26+
\.(cc|h$|html|doc|txt)|
27+
^doc/news
28+
)
29+
exclude: ^bundled/
30+
- repo: https://github.com/gitleaks/gitleaks
31+
rev: v8.21.2
32+
hooks:
33+
- id: gitleaks
34+
- repo: https://github.com/pre-commit/mirrors-clang-format
35+
rev: v16.0.6
36+
hooks:
37+
- id: clang-format
38+
files: |
39+
(?x)(
40+
\.inst\.in |
41+
\.cc |
42+
\.h
43+
)$
44+
- repo: https://github.com/crate-ci/typos
45+
rev: v1.28.1
46+
hooks:
47+
- id: typos
48+
files: (?x) ^(doc|examples|include|source|tests)/

CHANGELOG.md

Lines changed: 1 addition & 1 deletion

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ cmake_policy(VERSION 3.13.4)
4040

4141
if(POLICY CMP0074)
4242
# Introduced in CMake 3.12: find_package(<PackageName>) also searches
43-
# <PackageName>_ROOT CMake and environment variables when set to NEW.
43+
# <PackageName>_ROOT CMake and environment variables when set to NEW.
4444
cmake_policy(SET CMP0074 NEW)
4545
endif()
4646

README.md

Lines changed: 0 additions & 1 deletion

cmake/config/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,4 +192,3 @@ install(FILES
192192
#
193193

194194
message(STATUS "Setting up project configuration - Done")
195-

cmake/config/ConfigGit.cmake.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,3 @@ set(DEAL_II_GIT_BRANCH "@DEAL_II_GIT_BRANCH@")
2121
set(DEAL_II_GIT_REVISION "@DEAL_II_GIT_REVISION@")
2222
set(DEAL_II_GIT_SHORTREV "@DEAL_II_GIT_SHORTREV@")
2323
set(DEAL_II_GIT_TAG "@DEAL_II_GIT_TAG@")
24-

cmake/config/ConfigVersion.cmake.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,3 @@ else()
1414
set(PACKAGE_VERSION_EXACT TRUE)
1515
endif()
1616
endif()
17-

cmake/configure/TestBoostBug/polymorphic_derived2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ void polymorphic_derived2::serialize(
4444
);
4545

4646
// note: export has to be AFTER #includes for all archive classes
47-
BOOST_CLASS_EXPORT_IMPLEMENT(polymorphic_derived2)
47+
BOOST_CLASS_EXPORT_IMPLEMENT(polymorphic_derived2)

0 commit comments

Comments
 (0)