From 328535375be8369be61803e5d0015d800be8a8e4 Mon Sep 17 00:00:00 2001 From: Max R Date: Thu, 4 Apr 2024 14:14:53 -0400 Subject: [PATCH] Add more messaging --- README.md | 3 +++ pre_commit_hooks/fix_encoding_pragma.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9ae7ec5b..ee959fd8 100644 --- a/README.md +++ b/README.md @@ -127,6 +127,9 @@ The following arguments are available: removes UTF-8 byte order marker #### `fix-encoding-pragma` + +_Deprecated since py2 is EOL - use [pyupgrade](https://github.com/asottile/pyupgrade) instead._ + Add `# -*- coding: utf-8 -*-` to the top of python files. - To remove the coding pragma pass `--remove` (useful in a python3-only codebase) diff --git a/pre_commit_hooks/fix_encoding_pragma.py b/pre_commit_hooks/fix_encoding_pragma.py index f2cf38b2..eee67058 100644 --- a/pre_commit_hooks/fix_encoding_pragma.py +++ b/pre_commit_hooks/fix_encoding_pragma.py @@ -110,7 +110,8 @@ def _normalize_pragma(pragma: str) -> bytes: def main(argv: Sequence[str] | None = None) -> int: print( 'warning: this hook is deprecated and will be removed in a future ' - 'release because py2 is EOL', + 'release because py2 is EOL. instead, use ' + 'https://github.com/asottile/pyupgrade', file=sys.stderr, )