From adce4cfca3aa4cffd37956eb512ef945fb625410 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Sat, 24 Jun 2023 23:07:34 +0300 Subject: [PATCH 1/4] Add end-of-file-fixer to pre-commit, part of patchcheck's normalize_whitespace(python_files) --- .pre-commit-config.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 464bcde6e98424..e21feee3ed2634 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,6 +3,8 @@ repos: rev: v4.4.0 hooks: - id: check-yaml + - id: end-of-file-fixer + types_or: [python] - id: trailing-whitespace types_or: [c, python, rst] From d6d64c816df4dee0f0ae8569b6d1bff9f5f96d5a Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Sat, 24 Jun 2023 23:15:05 +0300 Subject: [PATCH 2/4] Makes sure files end in a newline and only a newline --- Lib/test/coding20731.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/Lib/test/coding20731.py b/Lib/test/coding20731.py index b0e227ad110e94..7b61917cacda4a 100644 --- a/Lib/test/coding20731.py +++ b/Lib/test/coding20731.py @@ -1,4 +1 @@ #coding:latin1 - - - From 2f800aa0451e504bba2639023578ffd92f4e6c1b Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Sun, 25 Jun 2023 12:57:44 +0300 Subject: [PATCH 3/4] Revert "Makes sure files end in a newline and only a newline" This reverts commit d6d64c816df4dee0f0ae8569b6d1bff9f5f96d5a. --- Lib/test/coding20731.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Lib/test/coding20731.py b/Lib/test/coding20731.py index 7b61917cacda4a..b0e227ad110e94 100644 --- a/Lib/test/coding20731.py +++ b/Lib/test/coding20731.py @@ -1 +1,4 @@ #coding:latin1 + + + From 35daebd11320f93a258aa772b04ba71c4bf965bf Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Sun, 25 Jun 2023 12:59:03 +0300 Subject: [PATCH 4/4] Exclude Lib/test/coding20731.py from end-of-file-fixer --- .pre-commit-config.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e21feee3ed2634..d62c57c044728f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,8 @@ repos: hooks: - id: check-yaml - id: end-of-file-fixer - types_or: [python] + types: [python] + exclude: Lib/test/coding20731.py - id: trailing-whitespace types_or: [c, python, rst]