File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 1010 name : pasteurize
1111 description : Pasteurize your Py3 code to ensure it is runnable on Py2.
1212 language : python
13+ language_version : python3
1314 types : [python]
1415 entry : pasteurize -w -n --no-diffs
Original file line number Diff line number Diff line change @@ -57,6 +57,8 @@ Features
5757 decoding the backported ``str `` and ``bytes `` objects. [This feature is
5858 currently in alpha.]
5959
60+ - support for pre-commit hooks
61+
6062.. _code-examples :
6163
6264Code examples
@@ -261,6 +263,39 @@ development, and will likely never be perfect.
261263
262264For more info, see :ref: `translation `.
263265
266+ Pre-commit hooks
267+ ----------------
268+
269+ `Pre-commit <https://pre-commit.com/ >`_ is a framework for managing and maintaining
270+ multi-language pre-commit hooks.
271+
272+ In case you need to port your project from Python 2 to Python 3, you might consider
273+ using such hook during the transition period.
274+
275+ First:
276+
277+ .. code-block :: bash
278+
279+ $ pip install pre-commit
280+
281+ and then in your project's directory:
282+
283+ .. code-block :: bash
284+
285+ $ pre-commit install
286+
287+ Next, you need to add this entry to your ``.pre-commit-config.yaml ``
288+
289+ .. code-block :: yaml
290+
291+ - repo : https://github.com/PythonCharmers/python-future
292+ rev : feature/pre-commit
293+ hooks :
294+ - id : futurize
295+ args : [--both-stages]
296+
297+ The ``args `` part is optional, by default only stage1 is applied.
298+
264299Licensing
265300---------
266301
You can’t perform that action at this time.
0 commit comments