Skip to content

Commit 8123e9f

Browse files
committed
Revert precommit changes
1 parent 17ce255 commit 8123e9f

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

.clang-format

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ IndentFunctionDeclarationAfterType: false
4949
IndentWidth: 4
5050
IndentWrappedFunctionNames: false
5151
IndentRequiresClause: true
52-
InsertNewlineAtEOF: true
5352
RequiresClausePosition: OwnLine
5453
KeepEmptyLinesAtTheStartOfBlocks: false
5554
MaxEmptyLinesToKeep: 1

pre-commit-hooks/json_in_cpp.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,7 @@ def replace_json(match):
4444

4545

4646
def fix_indentation(cpp_content: str) -> str:
47-
# Handle edge case: if content doesn't contain JSON patterns, return unchanged
48-
if "JSON(" not in cpp_content:
49-
return cpp_content
50-
5147
lines = cpp_content.splitlines()
52-
# Preserve original ending - check if original content ended with newline
53-
ends_with_newline = cpp_content.endswith('\n')
5448

5549
def find_indentation(line: str) -> int:
5650
return len(line) - len(line.lstrip())
@@ -72,11 +66,7 @@ def find_indentation(line: str) -> int:
7266
break
7367
lines[i] = lines[i][by_how_much:] if by_how_much > 0 else " " * (-by_how_much) + lines[i]
7468

75-
result = "\n".join(lines)
76-
# Only add newline if original content had one
77-
if ends_with_newline:
78-
result += "\n"
79-
return result
69+
return "\n".join(lines) + "\n"
8070

8171

8272
def process_file(file_path: Path, dry_run: bool) -> bool:

0 commit comments

Comments
 (0)