-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleaning up documentation surrounding the pre-commit hook [#484]
- Loading branch information
Showing
10 changed files
with
164 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<h3>About prospector</h3> | ||
<p> | ||
Prospector runs your favourite linters in a useful way | ||
Prospector runs your favourite linters | ||
</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ Contents | |
profiles | ||
suppression | ||
supported_tools | ||
pre-commit | ||
contrib | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
Pre-commit Hook | ||
=============== | ||
|
||
If you'd like Prospector to be run automatically when making changes to files in your Git | ||
repository, you can install `pre-commit`_ and add the following | ||
text to your repositories' ``.pre-commit-config.yaml``:: | ||
|
||
repos: | ||
- repo: https://github.com/PyCQA/prospector | ||
rev: 1.7.3 # The version of Prospector to use, if not 'master' for latest | ||
hooks: | ||
- id: prospector | ||
|
||
.. _pre-commit: https://pre-commit.com/ | ||
|
||
Commandline Arguments | ||
--------------------- | ||
|
||
Some controls for prospector, especially surrounding how the output is displayed, are not | ||
:doc:`configurable from a profile <profiles>`, only from the commandline. | ||
|
||
To add command-line arguments to the pre-commit hook config file:: | ||
|
||
repos: | ||
- repo: https://github.com/PyCQA/prospector | ||
rev: 1.7.3 | ||
hooks: | ||
- id: prospector | ||
args: | ||
- --summary-only | ||
|
||
|
||
Optional Tools | ||
-------------- | ||
|
||
By default the configuration will only install :doc:`the base supported tools <supported_tools>` and not optional tools. | ||
|
||
If you also use optional tools, for example bandit or mypy, then you can add | ||
them to the hook configuration like so:: | ||
|
||
repos: | ||
- repo: https://github.com/PyCQA/prospector | ||
rev: 1.7.3 | ||
hooks: | ||
- id: prospector | ||
additional_requirements: | ||
- bandit | ||
- mypy | ||
|
||
This is equivalent to running:: | ||
|
||
pip install prospector[with_bandit,with_mypy] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.