From 2c06b9f4290ccbedf3a6a506e17310b4e0f37d47 Mon Sep 17 00:00:00 2001 From: Alex Turbov Date: Tue, 21 Jan 2025 00:00:07 +0400 Subject: [PATCH] pre-commit: Add a hook to fix missed EOL at the end of files For now some files from `Tests/` have been excluded. However, some files could be really fixed and removed from exclude list. --- .pre-commit-config.yaml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 50560bea01..bee105aac4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -40,5 +40,35 @@ repos: | RunCMake/CTestResourceAllocation/invalid )\.json - id: check-yaml + - id: end-of-file-fixer + # NOTE Exclude tests directory: some test files have no + # the trailing EOL in the file intentionally but some + # just missed it. + # TODO Add the missed trailing EOL in the following files + # if possible. + exclude: >- + (?x)Tests/( + DelphiCoverage/src/UTCovTest\.pas + | FortranModules/in_interface/module\.f90 + | JavascriptCoverage/output\.json\.in + | Module/ExternalData/Alt/( + MyAlgoMap1-md5/dded55e43cd6529ee35d24113dfc87a3 + | SHA1/85158f0c1996837976e858c42a9a7634bfe91b93 + ) + | RunCMake/( + CMP0055/CMP0055-(NEW|OLD)-Reject-Arguments\.cmake + | CommandLine/E_cat_good_binary_cat-stdout\.txt + | define_property/define_property-INITIALIZE_FROM_VARIABLE-invalid_[12]-result\.txt + | FindMatlab/MatlabTest2-stderr\.txt + | string/UTF-(16|32)LE\.txt + | Syntax/BOM-UTF-(16|32)-LE.cmake + | Syntax/CommandEOF\.cmake + | VS10Project/shader2?\.hlsl + ) + | SourceGroups/README\.txt + | StringFileTest/test\.utf8 + | VSWindowsFormsResx/WindowsFormsResx/MyForm\.resx + | VSXaml/Package\.appxmanifest + ) - id: mixed-line-ending - id: trailing-whitespace