Skip to content

Commit

Permalink
GH-31545: [GLib] Enable clang-format (#40451)
Browse files Browse the repository at this point in the history
### Rationale for this change

This will help new contributors.

### What changes are included in this PR?

Create `c_glib/.clang-format` based on the current style. But there are many changes...

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* GitHub Issue: #31545

Authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
  • Loading branch information
kou authored Mar 11, 2024
1 parent 6ebd555 commit 6a78580
Show file tree
Hide file tree
Showing 176 changed files with 8,378 additions and 11,305 deletions.
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,10 @@ repos:
hooks:
- id: cython-lint
args: [--no-pycodestyle]
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v14.0.6
hooks:
- id: clang-format
name: C/GLib Format
files: >-
^c_glib/
45 changes: 45 additions & 0 deletions c_glib/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

---
AlignAfterOpenBracket: true
AlignConsecutiveMacros: AcrossEmptyLines
AllowAllArgumentsOnNextLine: false
AllowShortEnumsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AlwaysBreakAfterReturnType: All
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterFunction: true
AfterStruct: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
ColumnLimit: 90
ConstructorInitializerIndentWidth: 2
ContinuationIndentWidth: 2
IndentCaseBlocks: true
IndentPPDirectives: AfterHash
IndentWidth: 2
NamespaceIndentation: All
PPIndentWidth: 2
PackConstructorInitializers: CurrentLine
SortIncludes: Never
---
Language: JavaScript
SpacesInContainerLiterals: false
Loading

0 comments on commit 6a78580

Please sign in to comment.