Skip to content

Commit

Permalink
pre-commit/ClangFormat: enable formatting of supported files (#2787)
Browse files Browse the repository at this point in the history
* .clang-format: add settings for JavaScript (.js), JSON (.json) and Objective-C (.m) files
* enable pre-commit to run all .clang-format supported files
  • Loading branch information
nilason committed Jan 25, 2023
1 parent 36f4826 commit c8fad59
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
28 changes: 19 additions & 9 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
---
Language: Cpp
BasedOnStyle: LLVM
BasedOnStyle: LLVM
IndentWidth: 4

---
Language: Cpp
AccessModifierOffset: -4
AlignConsecutiveMacros:
Enabled: true
Enabled: true
AcrossEmptyLines: true
AcrossComments: true
PadOperators: true
AcrossComments: true
PadOperators: true
AlignEscapedNewlines: Left
AllowShortFunctionsOnASingleLine: InlineOnly
AlwaysBreakTemplateDeclarations: Yes
Expand All @@ -17,9 +20,16 @@ ForEachMacros:
- BOOST_FOREACH
IfMacros:
- SORT_DEBUG
IndentWidth: 4
MacroBlockBegin: GNO_BEGIN
MacroBlockEnd: GNO_END
SortIncludes: Never
...
MacroBlockEnd: GNO_END
SortIncludes: Never

---
Language: ObjC

---
Language: JavaScript

---
Language: Json
...
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: v15.0.6
hooks:
- id: clang-format
types_or: [c, c++, javascript, json, objective-c]
exclude: |
(?x)^(
man/jquery.fixedheadertable.min.js
)

0 comments on commit c8fad59

Please sign in to comment.