Skip to content

Commit

Permalink
Merge pull request #266 from chillenzer/add-pre-commit
Browse files Browse the repository at this point in the history
Add pre commit
  • Loading branch information
psychocoderHPC authored Nov 8, 2024
2 parents 486a295 + bd28b52 commit 29d2757
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 81 deletions.
17 changes: 6 additions & 11 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
---
# General options
Language: Cpp
Standard: c++20
DisableFormat: false

AccessModifierOffset: -4
AlignAfterOpenBracket: AlwaysBreak
AlignConsecutiveAssignments: false
Expand Down Expand Up @@ -35,7 +33,7 @@ BreakConstructorInitializers: BeforeComma
BreakInheritanceList: BeforeComma
BreakStringLiterals: true
ColumnLimit: 119
CommentPragmas: '^ COMMENT pragma:'
CommentPragmas: "^ COMMENT pragma:"
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
Expand All @@ -46,8 +44,8 @@ DerivePointerAlignment: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
IncludeBlocks: Regroup
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IncludeIsMainRegex: "(Test)?$"
IncludeIsMainSourceRegex: ""
IndentCaseBlocks: true
IndentCaseLabels: false
IndentExternBlock: AfterExternBlock
Expand All @@ -56,8 +54,8 @@ IndentPPDirectives: AfterHash
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MacroBlockBegin: ""
MacroBlockEnd: ""
MaxEmptyLinesToKeep: 2
NamespaceIndentation: All
PenaltyBreakAssignment: 2
Expand All @@ -84,7 +82,7 @@ SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInAngles: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
Expand All @@ -94,7 +92,6 @@ SpaceBeforeSquareBrackets: false
TabWidth: 4
UseCRLF: false
UseTab: Never

# Project specific options -- uncomment and modify as needed
#IncludeCategories:
# - Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Expand All @@ -110,5 +107,3 @@ UseTab: Never
# Future options - not supported in clang-format 11
# BitFieldColonSpacing: Both
# OperandAlignmentStyle: Align

...
5 changes: 2 additions & 3 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
---
Checks: '*,-llvm-header-guard,-fuchsia-default-arguments-declarations,-cppcoreguidelines-no-malloc,-cppcoreguidelines-owning-memory,-misc-non-private-member-variables-in-classes'
HeaderFilterRegex: '.*'
Checks: "*, -llvm-header-guard, -fuchsia-default-arguments-declarations, -cppcoreguidelines-no-malloc, -cppcoreguidelines-owning-memory, -misc-non-private-member-variables-in-classes"
HeaderFilterRegex: ".*"
19 changes: 12 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
name: Continuous Integration
on: [push, pull_request]
name: Pre-commit
on:
pull_request:
push:
branches: [main, test-me-*]
jobs:
clang-format:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DoozyX/[email protected]
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
exclude: "./thirdParty ./alpaka"
clangFormatVersion: 18
python-version: 3.x
- uses: pre-commit/[email protected]
- uses: pre-commit-ci/[email protected]
if: always()
45 changes: 45 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
minimum_pre_commit_version: 3.2.0 # necessitated by Lucas-C's hooks
default_install_hook_types: [pre-commit, pre-push]
exclude: |
(?x)^(
alpaka/.*|
thirdParty/.*
)$
repos:
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.8
hooks:
- id: clang-format
files: \.(cpp|hpp)
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: no-commit-to-branch
args: [-b, dev]
- id: check-merge-conflict
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-toml
- id: check-yaml
args: ["--allow-multiple-documents"]
- id: mixed-line-ending
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.4
hooks:
- id: forbid-tabs
- id: remove-tabs
- id: forbid-crlf
- id: remove-crlf
- repo: meta
hooks:
- id: check-useless-excludes
- repo: https://github.com/google/yamlfmt
rev: v0.13.0
hooks:
- id: yamlfmt
- repo: https://github.com/adrienverge/yamllint
rev: v1.35.1
hooks:
- id: yamllint
56 changes: 0 additions & 56 deletions .travis.yml

This file was deleted.

6 changes: 6 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
extends: default
rules:
document-start: disable
truthy: disable
comments: disable
line-length: disable
1 change: 0 additions & 1 deletion .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,3 @@
}
]
}

4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Change Log / Release Log for mallocMC
**Date:** 2021-02-18

This release removes the native usage of CUDA by alpaka.
Attention: This release depends on an unreleased [alpaka 0.5.0dev](https://github.com/alpaka-group/alpaka/commit/34870a73ecf702069465aa030fbdf301c4d22c61)
Attention: This release depends on an unreleased [alpaka 0.5.0dev](https://github.com/alpaka-group/alpaka/commit/34870a73ecf702069465aa030fbdf301c4d22c61)
version before the heavy alpaka namespace refactoring.

### Changes to mallocMC 2.4.0crp
Expand Down Expand Up @@ -41,7 +41,7 @@ This release removes the Boost dependency and switched to C++11.

**Bug fixes**
- Choose the value for the -arch nvcc flag depending on CUDA version #164 #165

**Misc:**
- Travis CI: GCC 5.5.0 + CUDA 9.1.85 #170
- Adding headers to projects and applied clang-tidy #171
Expand Down
2 changes: 1 addition & 1 deletion tests/verify_heap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ auto main(int argc, char** argv) -> int
{
if(correct)
{
std::cout << "\033[0;32mverification successful \033[0m\n";
std::cout << "\033[0;32mverification successful \033[0m\n";
return 0;
}
else
Expand Down

0 comments on commit 29d2757

Please sign in to comment.