Skip to content

Commit

Permalink
Merge branch 'master' of github.com:NVSL/cpp-common
Browse files Browse the repository at this point in the history
  • Loading branch information
suyashmahar committed Nov 16, 2023
2 parents 96bb8c5 + d0402b3 commit 2e40e3c
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
IndentWidth: 2
Language: Cpp
ColumnLimit: 80

AllowShortFunctionsOnASingleLine: Inline
IndentPPDirectives: BeforeHash

AlignEscapedNewlines: Left
AllowShortIfStatementsOnASingleLine: WithoutElse

# Configure indentation
NamespaceIndentation: All
IndentCaseBlocks: True

# Template declarations on a new line
AlwaysBreakTemplateDeclarations: Yes

AllowShortEnumsOnASingleLine: false
BraceWrapping:
AfterEnum: false

# Align stuff
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false

# Do not indent preprocessing directives
IndentPPDirectives: None
18 changes: 18 additions & 0 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: clang-format Check
on: [push, pull_request]
jobs:
formatting-check:
name: Formatting Check
runs-on: ubuntu-latest
strategy:
matrix:
path:
- 'include'
steps:
- uses: actions/checkout@v3
- name: Run clang-format style check for C/C++/Protobuf programs.
uses: jidicula/[email protected]
with:
clang-format-version: '13'
check-path: ${{ matrix.path }}
fallback-style: 'Mozilla' # optional

0 comments on commit 2e40e3c

Please sign in to comment.