Skip to content

Commit

Permalink
Add simple documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
dekoza committed Feb 7, 2020
1 parent a9c6a37 commit 6c6e3ae
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
name: pasteurize
description: Pasteurize your Py3 code to ensure it is runnable on Py2.
language: python
language_version: python3
types: [python]
entry: pasteurize -w -n --no-diffs
35 changes: 35 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ Features
decoding the backported ``str`` and ``bytes`` objects. [This feature is
currently in alpha.]

- support for pre-commit hooks

.. _code-examples:

Code examples
Expand Down Expand Up @@ -261,6 +263,39 @@ development, and will likely never be perfect.

For more info, see :ref:`translation`.

Pre-commit hooks
----------------

`Pre-commit <https://pre-commit.com/>`_ is a framework for managing and maintaining
multi-language pre-commit hooks.

In case you need to port your project from Python 2 to Python 3, you might consider
using such hook during the transition period.

First:

.. code-block:: bash
$ pip install pre-commit
and then in your project's directory:

.. code-block:: bash
$ pre-commit install
Next, you need to add this entry to your ``.pre-commit-config.yaml``

.. code-block:: yaml
- repo: https://github.com/PythonCharmers/python-future
rev: feature/pre-commit
hooks:
- id: futurize
args: [--both-stages]
The ``args`` part is optional, by default only stage1 is applied.

Licensing
---------

Expand Down

0 comments on commit 6c6e3ae

Please sign in to comment.