Skip to content

Commit

Permalink
Add a clang-format check to numba-dppy.
Browse files Browse the repository at this point in the history
  • Loading branch information
Diptorup Deb committed Apr 6, 2022
1 parent 2d6734d commit 3817c8a
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
BasedOnStyle: LLVM
IndentWidth: 4
AccessModifierOffset: -4
AlignEscapedNewlines: Right
AllowAllParametersOfDeclarationOnNextLine: false
BinPackParameters: false
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: MultiLine
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: false
AfterStruct: true
AfterUnion: true
AfterExternBlock: true
BeforeCatch: false
BeforeElse: true
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
22 changes: 22 additions & 0 deletions .github/workflows/cpp_style_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This is a workflow to format C/C++ sources with clang-format

name: C++ Code Style

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
pull_request:
push:
branches: [master]

jobs:
formatting-check:
name: clang-format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run clang-format style check for C/C++ programs.
uses: jidicula/[email protected]
with:
clang-format-version: '11'
check-path: 'numba_dppy/dpctl_iface'
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,8 @@ repos:
rev: v0.8.0
hooks:
- id: shellcheck
- repo: https://github.com/pocc/pre-commit-hooks
rev: v1.1.1
hooks:
- id: clang-format
args: ["-i"]

0 comments on commit 3817c8a

Please sign in to comment.