Skip to content

Commit 6c6e3ae

Browse files
committed
Add simple documentation
1 parent a9c6a37 commit 6c6e3ae

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

Diff for: .pre-commit-hooks.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
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

Diff for: README.rst

+35
Original file line numberDiff line numberDiff 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

6264
Code examples
@@ -261,6 +263,39 @@ development, and will likely never be perfect.
261263

262264
For 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+
264299
Licensing
265300
---------
266301

0 commit comments

Comments
 (0)