Initial commit
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
---
|
||||
Language: Cpp
|
||||
BasedOnStyle: Google
|
||||
IndentWidth: 2
|
||||
ColumnLimit: 120
|
||||
|
||||
# Braces
|
||||
BreakBeforeBraces: Attach
|
||||
AllowShortFunctionsOnASingleLine: All
|
||||
AllowShortIfStatementsOnASingleLine: AllIfsAndElse
|
||||
AllowShortLoopsOnASingleLine: true
|
||||
AllowShortBlocksOnASingleLine: Always
|
||||
AllowShortEnumsOnASingleLine: true
|
||||
|
||||
# Pointer alignment
|
||||
PointerAlignment: Left
|
||||
|
||||
# Breaking
|
||||
BinPackArguments: true
|
||||
BinPackParameters: BinPackAll
|
||||
BreakBeforeBinaryOperators: None
|
||||
AllowAllArgumentsOnNextLine: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: true
|
||||
|
||||
# Spacing
|
||||
SpaceInEmptyBlock: false
|
||||
SpaceBeforeParens: Never
|
||||
SpacesInParentheses: false
|
||||
SpacesBeforeTrailingComments: 1
|
||||
|
||||
# Indentation
|
||||
IndentCaseLabels: true
|
||||
CompactNamespaces: true
|
||||
|
||||
# Empty lines
|
||||
MaxEmptyLinesToKeep: 1
|
||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||
|
||||
# Alignment
|
||||
AlignConsecutiveAssignments: false
|
||||
AlignConsecutiveDeclarations: false
|
||||
AlignConsecutiveMacros: false
|
||||
AlignTrailingComments: false
|
||||
AlignOperands: DontAlign
|
||||
...
|
||||
@@ -0,0 +1,51 @@
|
||||
---
|
||||
Language: Cpp
|
||||
BasedOnStyle: Google
|
||||
IndentWidth: 4
|
||||
ColumnLimit: 120
|
||||
|
||||
# Pointer and reference alignment
|
||||
PointerAlignment: Left
|
||||
ReferenceAlignment: Left
|
||||
DerivePointerAlignment: false
|
||||
|
||||
# Line breaking
|
||||
AllowShortFunctionsOnASingleLine: Inline
|
||||
AllowShortIfStatementsOnASingleLine: WithoutElse
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AllowShortBlocksOnASingleLine: Empty
|
||||
BreakBeforeBinaryOperators: None
|
||||
BreakBeforeTernaryOperators: true
|
||||
|
||||
# Includes
|
||||
SortIncludes: CaseSensitive
|
||||
IncludeBlocks: Regroup
|
||||
IncludeCategories:
|
||||
- Regex: '^".*\.h"'
|
||||
Priority: 1
|
||||
- Regex: '^".*'
|
||||
Priority: 2
|
||||
- Regex: '^<.*\.h>'
|
||||
Priority: 3
|
||||
- Regex: '^<.*'
|
||||
Priority: 4
|
||||
|
||||
# Braces
|
||||
BreakBeforeBraces: Attach
|
||||
|
||||
# Indentation
|
||||
IndentCaseLabels: true
|
||||
IndentPPDirectives: AfterHash
|
||||
|
||||
# Spacing
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpacesBeforeTrailingComments: 2
|
||||
|
||||
# Comments
|
||||
ReflowComments: true
|
||||
FixNamespaceComments: true
|
||||
|
||||
# Empty lines
|
||||
MaxEmptyLinesToKeep: 1
|
||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||
...
|
||||
51
skills/clang-format/assets/configs/linux-kernel.clang-format
Normal file
51
skills/clang-format/assets/configs/linux-kernel.clang-format
Normal file
@@ -0,0 +1,51 @@
|
||||
---
|
||||
Language: Cpp
|
||||
BasedOnStyle: LLVM
|
||||
|
||||
# Use tabs
|
||||
IndentWidth: 8
|
||||
UseTab: Always
|
||||
TabWidth: 8
|
||||
ContinuationIndentWidth: 8
|
||||
|
||||
# Column limit
|
||||
ColumnLimit: 80
|
||||
|
||||
# Braces
|
||||
BreakBeforeBraces: Linux
|
||||
|
||||
# Indentation
|
||||
IndentCaseLabels: false
|
||||
IndentGotoLabels: false
|
||||
AccessModifierOffset: -8
|
||||
|
||||
# Line breaking
|
||||
AllowShortFunctionsOnASingleLine: None
|
||||
AllowShortIfStatementsOnASingleLine: Never
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AllowShortBlocksOnASingleLine: Never
|
||||
BreakBeforeBinaryOperators: None
|
||||
|
||||
# Pointer alignment
|
||||
PointerAlignment: Right
|
||||
|
||||
# Spacing
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpacesInParentheses: false
|
||||
|
||||
# Comments
|
||||
ReflowComments: false
|
||||
FixNamespaceComments: false
|
||||
|
||||
# Alignment
|
||||
AlignConsecutiveMacros: false
|
||||
AlignConsecutiveAssignments: false
|
||||
AlignConsecutiveDeclarations: false
|
||||
AlignTrailingComments: false
|
||||
|
||||
# Empty lines
|
||||
MaxEmptyLinesToKeep: 1
|
||||
|
||||
# Preprocessor
|
||||
IndentPPDirectives: None
|
||||
...
|
||||
@@ -0,0 +1,52 @@
|
||||
---
|
||||
Language: Cpp
|
||||
BasedOnStyle: Microsoft
|
||||
IndentWidth: 4
|
||||
ColumnLimit: 120
|
||||
|
||||
# Braces
|
||||
BreakBeforeBraces: Allman
|
||||
BraceWrapping:
|
||||
AfterFunction: true
|
||||
AfterControlStatement: Always
|
||||
AfterClass: true
|
||||
AfterStruct: true
|
||||
AfterEnum: true
|
||||
BeforeElse: true
|
||||
BeforeCatch: true
|
||||
|
||||
# Pointer alignment
|
||||
PointerAlignment: Left
|
||||
ReferenceAlignment: Left
|
||||
|
||||
# Indentation
|
||||
IndentCaseLabels: false
|
||||
IndentAccessModifiers: false
|
||||
AccessModifierOffset: -4
|
||||
|
||||
# Line breaking
|
||||
AllowShortFunctionsOnASingleLine: None
|
||||
AllowShortIfStatementsOnASingleLine: Never
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
BreakBeforeBinaryOperators: None
|
||||
|
||||
# Spacing
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpacesBeforeTrailingComments: 1
|
||||
|
||||
# Includes
|
||||
SortIncludes: CaseSensitive
|
||||
IncludeBlocks: Preserve
|
||||
|
||||
# Comments
|
||||
ReflowComments: true
|
||||
FixNamespaceComments: true
|
||||
|
||||
# Alignment
|
||||
AlignConsecutiveAssignments: false
|
||||
AlignConsecutiveDeclarations: false
|
||||
AlignTrailingComments: true
|
||||
|
||||
# Empty lines
|
||||
MaxEmptyLinesToKeep: 1
|
||||
...
|
||||
@@ -0,0 +1,62 @@
|
||||
---
|
||||
Language: Cpp
|
||||
BasedOnStyle: LLVM
|
||||
Standard: c++20
|
||||
|
||||
IndentWidth: 2
|
||||
ColumnLimit: 100
|
||||
|
||||
# Pointer alignment
|
||||
PointerAlignment: Left
|
||||
ReferenceAlignment: Left
|
||||
DerivePointerAlignment: false
|
||||
|
||||
# Braces
|
||||
BreakBeforeBraces: Attach
|
||||
Cpp11BracedListStyle: true
|
||||
|
||||
# Breaking
|
||||
AllowShortFunctionsOnASingleLine: InlineOnly
|
||||
AllowShortLambdasOnASingleLine: All
|
||||
AllowShortIfStatementsOnASingleLine: WithoutElse
|
||||
AlwaysBreakTemplateDeclarations: Yes
|
||||
BreakConstructorInitializers: BeforeColon
|
||||
BreakInheritanceList: BeforeColon
|
||||
|
||||
# Indentation
|
||||
IndentCaseLabels: true
|
||||
IndentPPDirectives: AfterHash
|
||||
IndentRequiresClause: true
|
||||
IndentWrappedFunctionNames: false
|
||||
|
||||
# Spacing
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceBeforeCpp11BracedList: false
|
||||
SpacesBeforeTrailingComments: 2
|
||||
|
||||
# Includes
|
||||
SortIncludes: CaseSensitive
|
||||
IncludeBlocks: Regroup
|
||||
IncludeCategories:
|
||||
- Regex: '^<.*\.h>$'
|
||||
Priority: 1
|
||||
- Regex: '^<.*>$'
|
||||
Priority: 2
|
||||
- Regex: '.*'
|
||||
Priority: 3
|
||||
|
||||
# Alignment
|
||||
AlignConsecutiveMacros: true
|
||||
AlignConsecutiveAssignments: false
|
||||
AlignConsecutiveDeclarations: false
|
||||
AlignOperands: Align
|
||||
AlignTrailingComments: true
|
||||
|
||||
# Comments
|
||||
ReflowComments: true
|
||||
FixNamespaceComments: true
|
||||
|
||||
# Empty lines
|
||||
MaxEmptyLinesToKeep: 1
|
||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||
...
|
||||
@@ -0,0 +1,41 @@
|
||||
---
|
||||
# C++ Configuration
|
||||
Language: Cpp
|
||||
BasedOnStyle: Google
|
||||
IndentWidth: 4
|
||||
ColumnLimit: 100
|
||||
PointerAlignment: Left
|
||||
BreakBeforeBraces: Attach
|
||||
SortIncludes: CaseSensitive
|
||||
---
|
||||
# JavaScript/TypeScript Configuration
|
||||
Language: JavaScript
|
||||
BasedOnStyle: Google
|
||||
IndentWidth: 2
|
||||
ColumnLimit: 100
|
||||
JavaScriptQuotes: Single
|
||||
JavaScriptWrapImports: true
|
||||
SpacesInContainerLiterals: true
|
||||
---
|
||||
# JSON Configuration
|
||||
Language: Json
|
||||
IndentWidth: 2
|
||||
BreakArrays: true
|
||||
---
|
||||
# Protocol Buffers Configuration
|
||||
Language: Proto
|
||||
BasedOnStyle: Google
|
||||
IndentWidth: 2
|
||||
---
|
||||
# Java Configuration
|
||||
Language: Java
|
||||
BasedOnStyle: Google
|
||||
IndentWidth: 4
|
||||
ColumnLimit: 120
|
||||
JavaImportGroups:
|
||||
- com.mycompany
|
||||
- com
|
||||
- org
|
||||
- java
|
||||
- javax
|
||||
---
|
||||
@@ -0,0 +1,59 @@
|
||||
---
|
||||
Language: Cpp
|
||||
BasedOnStyle: LLVM
|
||||
IndentWidth: 4
|
||||
ColumnLimit: 100
|
||||
|
||||
# Braces
|
||||
BreakBeforeBraces: Stroustrup
|
||||
|
||||
# Pointer alignment
|
||||
PointerAlignment: Left
|
||||
|
||||
# Breaking
|
||||
AllowShortFunctionsOnASingleLine: None
|
||||
AllowShortIfStatementsOnASingleLine: Never
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AllowShortBlocksOnASingleLine: Never
|
||||
BinPackArguments: false
|
||||
BinPackParameters: Never
|
||||
BreakBeforeBinaryOperators: NonAssignment
|
||||
|
||||
# Spacing
|
||||
SpaceInEmptyBlock: true
|
||||
SpaceAfterCStyleCast: true
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpacesBeforeTrailingComments: 3
|
||||
MaxEmptyLinesToKeep: 2
|
||||
KeepEmptyLinesAtTheStartOfBlocks: true
|
||||
|
||||
# Indentation
|
||||
IndentCaseLabels: true
|
||||
IndentPPDirectives: AfterHash
|
||||
IndentWrappedFunctionNames: true
|
||||
|
||||
# Alignment
|
||||
AlignConsecutiveMacros:
|
||||
Enabled: true
|
||||
AcrossEmptyLines: true
|
||||
AlignConsecutiveAssignments:
|
||||
Enabled: true
|
||||
AlignConsecutiveDeclarations:
|
||||
Enabled: true
|
||||
AlignOperands: Align
|
||||
AlignTrailingComments:
|
||||
Kind: Always
|
||||
OverEmptyLines: 1
|
||||
|
||||
# Includes
|
||||
SortIncludes: CaseSensitive
|
||||
IncludeBlocks: Regroup
|
||||
|
||||
# Comments
|
||||
ReflowComments: true
|
||||
FixNamespaceComments: true
|
||||
|
||||
# Empty lines
|
||||
EmptyLineBeforeAccessModifier: Always
|
||||
EmptyLineAfterAccessModifier: Always
|
||||
...
|
||||
@@ -0,0 +1,3 @@
|
||||
;; Emacs configuration for clang-format integration
|
||||
(load "/path/to/clang-format.el")
|
||||
(global-set-key [C-M-tab] 'clang-format-region)
|
||||
4
skills/clang-format/assets/integrations/pre-commit
Executable file
4
skills/clang-format/assets/integrations/pre-commit
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
# Pre-commit hook for clang-format
|
||||
# Format staged changes before commit
|
||||
git clang-format --staged --quiet
|
||||
@@ -0,0 +1,21 @@
|
||||
" Vim configuration for clang-format integration
|
||||
" Format on save for C++ files
|
||||
|
||||
" Python 3 support
|
||||
if has('python3')
|
||||
map <C-K> :py3f /path/to/clang-format.py<cr>
|
||||
imap <C-K> <c-o>:py3f /path/to/clang-format.py<cr>
|
||||
endif
|
||||
|
||||
" Python 2 support
|
||||
if has('python')
|
||||
map <C-K> :pyf /path/to/clang-format.py<cr>
|
||||
imap <C-K> <c-o>:pyf /path/to/clang-format.py<cr>
|
||||
endif
|
||||
|
||||
" Format on save
|
||||
function! Formatonsave()
|
||||
let l:formatdiff = 1
|
||||
py3f /path/to/clang-format.py
|
||||
endfunction
|
||||
autocmd BufWritePre *.h,*.cc,*.cpp call Formatonsave()
|
||||
Reference in New Issue
Block a user