Skip to content

Commit 905e304

Browse files
committed
[CI] Add prek hook end-of-file-fixer; Auto fix C# files
1 parent 736554e commit 905e304

18 files changed

Lines changed: 6 additions & 27 deletions

File tree

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
# | **Priority 10** | `identity`, `check-hooks-apply` | **Meta & Setup**: Ensure environment is valid before executing heavy checks. |
3232
# | **Priority 20** | `fix-byte-order-marker` | **File Cleanups (Broad)**: Fix BOM first so subsequent steps work with clean UTF-8 text. |
3333
# | **Priority 30** | `trailing-whitespace` | **Formatting (Broad)**: Cleans up whitespace on files before other hooks validate them. |
34+
# | **Priority 35** | `end-of-file-fixer` | **File Cleanups (Broad)**: Makes sure files end in a newline and only a newline. |
3435
# | **Priority 40** | `doctoc`, `oxipng`, `file-contents-sorter` | **Disjoint Modifiers**: These modify different sets of files (`README.md`, `.png` files, and `codespell.txt` respectively). Running them concurrently is safe. |
3536
# | **Priority 50** | `codespell`, `check-ast`, `check-builtin-literals`, `check-case-conflict`, `check-executables-have-shebangs`, `check-illegal-windows-names`, `check-json`, `check-merge-conflict`, `check-vcs-permalinks`, `check-xml`, `check-yaml`, `debug-statements`, `detect-aws-credentials`, `detect-private-key`, `forbid-submodules`, `gitleaks`, `bandit`|
3637
# | | **Read-Only / Syntax / Security**: The bulk of the suite. These hooks only read and validate files without modifying them, allowing full parallel execution. |
@@ -80,6 +81,11 @@ repos:
8081
- repo: https://github.com/pre-commit/pre-commit-hooks
8182
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
8283
hooks:
84+
- id: end-of-file-fixer
85+
name: run end-of-file-fixer
86+
description: makes sure files end in a newline and only a newline
87+
files: \.cs$
88+
priority: 35
8389
- id: trailing-whitespace
8490
name: run trailing-whitespace
8591
description: trims trailing whitespace

src/Lucene.Net.Classification/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,3 @@
3838

3939
// The following GUID is for the ID of the typelib if this project is exposed to COM
4040
[assembly: Guid("ff6180c7-579d-4557-bf6a-ddd139fad2e4")]
41-
42-

src/Lucene.Net.Codecs/Appending/AppendingCodec.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,3 @@ public AppendingCodec()
4343
public override PostingsFormat PostingsFormat => _postings;
4444
}
4545
}
46-

src/Lucene.Net.Codecs/Appending/AppendingPostingsFormat.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,3 @@ public override FieldsProducer FieldsProducer(SegmentReadState state)
5959
}
6060
}
6161
}
62-

src/Lucene.Net.Codecs/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,3 @@
3838

3939
// The following GUID is for the ID of the typelib if this project is exposed to COM
4040
[assembly: Guid("03ad88e5-c647-4821-9c75-ca5507ab18f0")]
41-
42-

src/Lucene.Net.Demo/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,3 @@
3838

3939
// The following GUID is for the ID of the typelib if this project is exposed to COM
4040
[assembly: Guid("4bcd7980-0cf4-4da0-b069-f555a41cb44d")]
41-
42-

src/Lucene.Net.Expressions/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,3 @@
3838

3939
// The following GUID is for the ID of the typelib if this project is exposed to COM
4040
[assembly: Guid("6f5d9768-c42b-4dca-881b-001f61618cac")]
41-
42-

src/Lucene.Net.Grouping/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,3 @@
3838

3939
// The following GUID is for the ID of the typelib if this project is exposed to COM
4040
[assembly: Guid("02bab603-067d-48b1-aedd-316849652568")]
41-
42-

src/Lucene.Net.Queries/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,3 @@
3838

3939
// The following GUID is for the ID of the typelib if this project is exposed to COM
4040
[assembly: Guid("76a14bc5-8f0f-4de4-b501-423d4c1a20a5")]
41-
42-

src/Lucene.Net.Sandbox/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,3 @@
3838

3939
// The following GUID is for the ID of the typelib if this project is exposed to COM
4040
[assembly: Guid("13274ba9-9052-4354-8ffe-e3f32593368f")]
41-
42-

0 commit comments

Comments
 (0)