From 25c9e1ffee43060571d93d00bc4d600b78e32241 Mon Sep 17 00:00:00 2001 From: Andrew Date: Sat, 17 Apr 2021 12:34:40 -0400 Subject: [PATCH 1/5] Adding documentation about pre-commit hooks This commit adds documentation about using pre-commit when a user has multiple requiments. A user need to have multiple hooks for each requirements file and this commit makes that informationn explicit in the documentation. --- README.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.rst b/README.rst index aac0ccb5e..94f109260 100644 --- a/README.rst +++ b/README.rst @@ -358,6 +358,26 @@ You might want to customize ``pip-compile`` args by configuring ``args`` and/or files: ^requirements/production\.(in|txt)$ args: [--index-url=https://example.com, requirements/production.in] +If you have multiple requirement files make sure you create a hook for each file. + +.. code-bloack:: yaml + + repos: + - repo: https://github.com/jazzband/pip-tools + rev: 5.3.1 + hooks: + - id: pip-compile + name: pip-compile setup.py + files: ^setup\.py$ + - id: pip-compile + name: pip-compile requirements-dev.in + args: [requirements-dev.in] + files: ^requirements-dev\.(in|txt)$ + - id: pip-compile + name: pip-compile requirements-lint.in + args: [requirements-lint.in] + files: ^requirements-lint\.(in|txt)$ + Example usage for ``pip-sync`` ============================== From 86b71f9a6f5740bf9d7fe790aff5e1759c3c7625 Mon Sep 17 00:00:00 2001 From: Andrew Date: Sat, 17 Apr 2021 12:45:17 -0400 Subject: [PATCH 2/5] Small change proposed by linter --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 94f109260..4ff275a51 100644 --- a/README.rst +++ b/README.rst @@ -360,7 +360,7 @@ You might want to customize ``pip-compile`` args by configuring ``args`` and/or If you have multiple requirement files make sure you create a hook for each file. -.. code-bloack:: yaml +.. code-block:: yaml repos: - repo: https://github.com/jazzband/pip-tools From 26c11db2848a0f49c902a2fd62299d6133f263aa Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 25 Apr 2021 13:07:01 -0400 Subject: [PATCH 3/5] Adding a requirements.txt file to the exmples set in the pip compile instructions --- README.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.rst b/README.rst index 4ff275a51..a411e4b08 100644 --- a/README.rst +++ b/README.rst @@ -377,6 +377,10 @@ If you have multiple requirement files make sure you create a hook for each file name: pip-compile requirements-lint.in args: [requirements-lint.in] files: ^requirements-lint\.(in|txt)$ + - id: pip-compile + name: pip-compile requirements.txt + args: [requirements.txt] + files: ^requirements\.(in|txt)$ Example usage for ``pip-sync`` From 600ee4f0b74e3350cffe5cd3d60cae92a2d4ae87 Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Sat, 5 Jun 2021 08:21:13 +0100 Subject: [PATCH 4/5] Update README.rst Co-authored-by: Albert Tugushev --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index a411e4b08..506d6983c 100644 --- a/README.rst +++ b/README.rst @@ -368,7 +368,7 @@ If you have multiple requirement files make sure you create a hook for each file hooks: - id: pip-compile name: pip-compile setup.py - files: ^setup\.py$ + files: ^(setup\.py|requirements\.txt)$ - id: pip-compile name: pip-compile requirements-dev.in args: [requirements-dev.in] From ea239a2da6e9e8fce4c58a8535e83dcb54c4d79e Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Fri, 11 Jun 2021 14:15:51 +0100 Subject: [PATCH 5/5] Update README.rst --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 9613f9e4b..4134f30e8 100644 --- a/README.rst +++ b/README.rst @@ -373,7 +373,7 @@ If you have multiple requirement files make sure you create a hook for each file .. code-block:: yaml repos: - - repo: https://github.com/jazzband/pip-tools + - repo: https://github.com/jazzband/pip-tools rev: 5.3.1 hooks: - id: pip-compile