File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 145145 language : python
146146 types : [text]
147147- id : fix-encoding-pragma
148- name : fix python encoding pragma
148+ name : fix python encoding pragma (deprecated)
149149 description : ' adds # -*- coding: utf-8 -*- to the top of python files.'
150150 language : python
151151 entry : fix-encoding-pragma
Original file line number Diff line number Diff line change @@ -127,6 +127,9 @@ The following arguments are available:
127127removes UTF-8 byte order marker
128128
129129#### ` fix-encoding-pragma `
130+
131+ _ Deprecated since py2 is EOL - use [ pyupgrade] ( https://github.com/asottile/pyupgrade ) instead._
132+
130133Add ` # -*- coding: utf-8 -*- ` to the top of python files.
131134 - To remove the coding pragma pass ` --remove ` (useful in a python3-only codebase)
132135
Original file line number Diff line number Diff line change 11from __future__ import annotations
22
33import argparse
4+ import sys
45from typing import IO
56from typing import NamedTuple
67from typing import Sequence
@@ -107,6 +108,13 @@ def _normalize_pragma(pragma: str) -> bytes:
107108
108109
109110def main (argv : Sequence [str ] | None = None ) -> int :
111+ print (
112+ 'warning: this hook is deprecated and will be removed in a future '
113+ 'release because py2 is EOL. instead, use '
114+ 'https://github.com/asottile/pyupgrade' ,
115+ file = sys .stderr ,
116+ )
117+
110118 parser = argparse .ArgumentParser (
111119 'Fixes the encoding pragma of python files' ,
112120 )
You can’t perform that action at this time.
0 commit comments