-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Add pre-commit config and dev instructions #21583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
ci: | ||
autofix_prs: false | ||
autoupdate_schedule: 'quarterly' | ||
exclude: | | ||
(?x)^( | ||
extern| | ||
lib/matplotlib/mpl-data| | ||
doc/devel/gitwash| | ||
doc/users/prev| | ||
doc/api/prev| | ||
lib/matplotlib/tests/tinypages | ||
) | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.0.1 | ||
hooks: | ||
- id: check-added-large-files | ||
- id: check-docstring-first | ||
- id: end-of-file-fixer | ||
exclude_types: [svg] | ||
- id: mixed-line-ending | ||
- id: trailing-whitespace | ||
exclude_types: [svg] | ||
- repo: https://github.com/pycqa/flake8 | ||
tacaswell marked this conversation as resolved.
Show resolved
Hide resolved
|
||
rev: 3.9.2 | ||
hooks: | ||
- id: flake8 | ||
additional_dependencies: [pydocstyle>5.1.0, flake8-docstrings>1.4.0] | ||
args: ["--docstring-convention=all"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,6 +60,16 @@ true for ``*.py`` files. If you change the C-extension source (which might | |
also happen if you change branches) you will have to re-run | ||
``python -m pip install -ve .`` | ||
|
||
Installing pre-commit hooks | ||
=========================== | ||
You can optionally install `pre-commit <https://pre-commit.com/>`_ hooks. | ||
These will automatically check flake8 and other style issues when you run | ||
``git commit``. The hooks are defined in the top level | ||
``.pre-commit-config.yaml`` file. To install the hooks :: | ||
|
||
pip install pre-commit | ||
pre-commit install | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add a sentence about where the config file is so devs can modify their local version? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added something, let me know if that's what you were looking for |
||
Installing additional dependencies for development | ||
================================================== | ||
See :ref:`development-dependencies`. |
Uh oh!
There was an error while loading. Please reload this page.