Skip to content

Commit aee5b0d

Browse files
authored
Format JSON. Update pre-commit hooks. (#501)
1 parent 9827844 commit aee5b0d

File tree

3 files changed

+7146
-7143
lines changed

3 files changed

+7146
-7143
lines changed

.clang-format

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
BasedOnStyle: Google
23
AccessModifierOffset: -1
34
AlignEscapedNewlinesLeft: true
@@ -14,7 +15,7 @@ BreakBeforeBraces: Linux
1415
BreakBeforeTernaryOperators: true
1516
BreakConstructorInitializersBeforeComma: false
1617
ColumnLimit: 0
17-
CommentPragmas: '^ IWYU pragma:'
18+
CommentPragmas: '^ IWYU pragma:'
1819
ConstructorInitializerAllOnOneLineOrOnePerLine: true
1920
ConstructorInitializerIndentWidth: 2
2021
ContinuationIndentWidth: 2
@@ -23,10 +24,10 @@ DerivePointerBinding: false
2324
ExperimentalAutoDetectBinPacking: false
2425
IndentCaseLabels: true
2526
IndentFunctionDeclarationAfterType: true
26-
IndentWidth: 2
27+
IndentWidth: 2
2728
# It is broken on windows. Breaks all #include "header.h"
2829
---
29-
Language: Cpp
30+
Language: Cpp
3031
MaxEmptyLinesToKeep: 1
3132
KeepEmptyLinesAtTheStartOfBlocks: true
3233
NamespaceIndentation: None
@@ -43,19 +44,18 @@ SpaceBeforeAssignmentOperators: true
4344
SpaceBeforeParens: ControlStatements
4445
SpaceInEmptyParentheses: false
4546
SpacesBeforeTrailingComments: 1
46-
SpacesInAngles: false
47+
SpacesInAngles: false
4748
SpacesInContainerLiterals: true
4849
SpacesInCStyleCastParentheses: false
4950
SpacesInParentheses: false
50-
Standard: Cpp11
51-
TabWidth: 2
52-
UseTab: Never
51+
Standard: Cpp11
52+
TabWidth: 2
53+
UseTab: Never
5354
---
5455
# Do not format protobuf files
5556
Language: Proto
5657
DisableFormat: true
57-
# ---
58-
# # Since clang-format 13.0.0
59-
# Language: Json
60-
# # O2 dumps JSON files with 4-space indents.
61-
# IndentWidth: 4
58+
---
59+
Language: Json
60+
# O2 dumps JSON files with 4-space indents.
61+
IndentWidth: 4

.pre-commit-config.yaml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,49 +4,52 @@
44

55
repos:
66
- repo: https://github.com/pre-commit/pre-commit-hooks
7-
rev: v5.0.0
7+
rev: v6.0.0
88
hooks:
99
- id: check-added-large-files
1010
- id: check-ast
1111
- id: check-builtin-literals
1212
- id: check-docstring-first
1313
- id: check-executables-have-shebangs
14+
- id: check-json
1415
- id: check-merge-conflict
1516
- id: check-symlinks
16-
- id: check-json
1717
- id: check-toml
1818
- id: check-yaml
19+
args: [--allow-multiple-documents]
1920
- id: debug-statements
2021
- id: end-of-file-fixer
2122
- id: mixed-line-ending
2223
- id: name-tests-test
24+
- id: pretty-format-json
25+
args: [--autofix, --no-ensure-ascii, --indent, "4"]
2326
- id: requirements-txt-fixer
2427
- id: trailing-whitespace
2528
- repo: https://github.com/astral-sh/ruff-pre-commit
26-
rev: v0.11.10 # ruff version
29+
rev: v0.12.12 # ruff version
2730
hooks:
2831
- id: ruff # linter
2932
args: ["--fix"]
3033
- id: ruff-format # formatter
3134
- repo: https://github.com/asottile/pyupgrade
32-
rev: v3.19.1
35+
rev: v3.20.0
3336
hooks:
3437
- id: pyupgrade
3538
args: ["--py310-plus"]
3639
- repo: https://github.com/shellcheck-py/shellcheck-py
37-
rev: v0.10.0.1
40+
rev: v0.11.0.1
3841
hooks:
3942
- id: shellcheck
4043
- repo: https://github.com/google/yamlfmt
41-
rev: v0.16.0
44+
rev: v0.17.2
4245
hooks:
4346
- id: yamlfmt
4447
- repo: https://github.com/adrienverge/yamllint
4548
rev: v1.37.1
4649
hooks:
4750
- id: yamllint
4851
- repo: https://github.com/pre-commit/mirrors-clang-format
49-
rev: v20.1.4 # clang-format version
52+
rev: v21.1.0 # clang-format version
5053
hooks:
5154
- id: clang-format
5255
- repo: https://github.com/cpplint/cpplint

0 commit comments

Comments
 (0)