Skip to content

Commit

Permalink
Merge pull request #1332 from henryiii/henryiii/chore/pre-commit
Browse files Browse the repository at this point in the history
chore: add some more pre-commit checks
  • Loading branch information
pradyunsg committed Nov 2, 2023
2 parents ae7b49f + a1a3c7f commit c44afaf
Show file tree
Hide file tree
Showing 15 changed files with 45 additions and 23 deletions.
28 changes: 28 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,32 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace

- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
args: ["-L", "ned"]

- repo: local
hooks:
- id: disallow-caps
name: Disallow improper capitalization
language: pygrep
entry: PyBind|Numpy|Cmake|CCache|Github|PyTest
exclude: .pre-commit-config.yaml

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal
4 changes: 2 additions & 2 deletions source/contribute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ We use `Weblate`_ to manage translations of this project.
Please visit the `packaging.python.org`_ project on Weblate to contribute.

If you are experiencing issues while you are working on translations,
please open an issue on `Github`_.
please open an issue on `GitHub`_.

.. tip::

Any translations of this project should follow `reStructuredText syntax`_.

.. _Weblate: https://weblate.org/
.. _packaging.python.org: https://hosted.weblate.org/projects/pypa/packaging-python-org/
.. _Github: https://github.com/pypa/packaging.python.org/issues
.. _GitHub: https://github.com/pypa/packaging.python.org/issues
.. _reStructuredText syntax: https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html

Adding a language
Expand Down
2 changes: 1 addition & 1 deletion source/discussions/deploying-python-applications.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ directory, independent of any other Python installation on the computer.

A big advantage of Pynsist is that the Windows packages can be built on Linux.
There are several examples for different kinds of programs (console, GUI) in
the `documentation <pynsist:index>`. The tool is released
the :any:`documentation <pynsist:index>`. The tool is released
under the MIT-licence.

Application bundles
Expand Down
2 changes: 1 addition & 1 deletion source/guides/distributing-packages-using-setuptools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ can be specified with the ``long_description_content_type`` argument, which can
be one of ``text/plain``, ``text/x-rst``, or ``text/markdown``, corresponding
to no formatting, `reStructuredText (reST)
<https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#reference-names>`_,
and the Github-flavored Markdown dialect of `Markdown
and the GitHub-flavored Markdown dialect of `Markdown
<https://daringfireball.net/projects/markdown/>`_ respectively.

``url``
Expand Down
4 changes: 2 additions & 2 deletions source/guides/dropping-older-python-versions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ explicitly set ``universal`` to ``0``:
# setup.cfg
[bdist_wheel]
universal = 0 # Make the generated wheels have `py3` tag
universal = 0 # Make the generated wheels have "py3" tag
.. tip::

Expand Down Expand Up @@ -71,7 +71,7 @@ Steps:
py -m pip install --upgrade setuptools twine
`setuptools` version should be above 24.0.0.
``setuptools`` version should be above 24.0.0.

2. Specify the version ranges for supported Python distributions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion source/guides/supporting-multiple-python-versions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Automated testing and continuous integration

Several hosted services for automated testing are available. These services
will typically monitor your source code repository (e.g. at
`Github <https://github.com>`_ or `Bitbucket <https://bitbucket.org>`_)
`GitHub <https://github.com>`_ or `Bitbucket <https://bitbucket.org>`_)
and run your project's test suite every time a new commit is made.

These services also offer facilities to run your project's test suite on
Expand Down
6 changes: 3 additions & 3 deletions source/guides/supporting-windows-using-appveyor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ non-trivial, and may require buying software licenses.

The Appveyor service is a continuous integration service, much like the
better-known `Travis`_ service that is commonly used for testing by projects
hosted on `Github`_. However, unlike Travis, the build workers on Appveyor are
hosted on `GitHub`_. However, unlike Travis, the build workers on Appveyor are
Windows hosts and have the necessary compilers installed to build Python
extensions.

Expand All @@ -44,7 +44,7 @@ have an account on the service. Instructions on setting up an account are given
in `the Appveyor documentation <https://www.appveyor.com/docs/>`__. The free tier
of account is perfectly adequate for open source projects.

Appveyor provides integration with `Github`_ and `Bitbucket`_, so as long as
Appveyor provides integration with `GitHub`_ and `Bitbucket`_, so as long as
your project is hosted on one of those two services, setting up Appveyor
integration is straightforward.

Expand Down Expand Up @@ -241,5 +241,5 @@ For reference, the SDK setup support script is listed here:

.. _Appveyor: https://www.appveyor.com/
.. _Travis: https://travis-ci.org/
.. _Github: https://github.com
.. _GitHub: https://github.com
.. _Bitbucket: https://bitbucket.org/
4 changes: 2 additions & 2 deletions source/key_projects.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Content Delivery Network (CDN).
build
=====

`Docs <build:index>` |
:any:`Docs <build:index>` |
`Issues <https://github.com/pypa/build/issues>`__ |
`GitHub <https://github.com/pypa/build>`__ |
`PyPI <https://pypi.org/project/build>`__
Expand Down Expand Up @@ -180,7 +180,7 @@ Pipenv
Pipenv is a project that aims to bring the best of all packaging worlds to the
Python world. It harnesses :ref:`Pipfile`, :ref:`pip`, and :ref:`virtualenv`
into one single toolchain. It can autoimport ``requirements.txt`` and also
check for CVEs in `Pipfile` using `safety <https://pyup.io/safety>`_.
check for CVEs in `Pipfile`_ using `safety <https://pyup.io/safety>`_.

Pipenv aims to help users manage environments, dependencies, and
imported packages on the command line. It also works well on Windows
Expand Down
2 changes: 1 addition & 1 deletion source/specifications/core-metadata.rst
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ Other parameters might be specific to the chosen subtype. For example, for the
specifying the variant of Markdown in use (defaults to ``GFM`` if not
specified). Currently, two variants are recognized:

- ``GFM`` for :rfc:`Github-flavored Markdown <7764#section-3.2>`
- ``GFM`` for :rfc:`GitHub-flavored Markdown <7764#section-3.2>`
- ``CommonMark`` for :rfc:`CommonMark <7764#section-3.5>`

Example::
Expand Down
2 changes: 1 addition & 1 deletion source/specifications/declaring-build-dependencies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
Declaring build system dependencies
===================================

`pyproject.toml` is a build system independent file format defined in :pep:`518`
``pyproject.toml`` is a build system independent file format defined in :pep:`518`
that projects may provide in order to declare any Python level dependencies that
must be installed in order to run the project's build system successfully.
1 change: 0 additions & 1 deletion source/specifications/dependency-specifiers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -488,4 +488,3 @@ References
.. [#future_versions] Future Python versions might be problematic with the
definition of Environment Marker Variable ``python_version``
(https://github.com/python/peps/issues/560)
2 changes: 1 addition & 1 deletion source/specifications/externally-managed-environments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ environment, and should instead guide the end user towards using

History
=======
- `June 2022 <https://discuss.python.org/t/pep-668-marking-python-base-environments-as-externally-managed/10302/44>`_: ``EXTERNALLY-MANAGED`` marker file was originally specified in :pep:`668#marking-an-interpreter-as-using-an-external-package-manager`.
- `June 2022 <https://discuss.python.org/t/pep-668-marking-python-base-environments-as-externally-managed/10302/44>`_: ``EXTERNALLY-MANAGED`` marker file was originally specified in :pep:`668#marking-an-interpreter-as-using-an-external-package-manager`.
2 changes: 1 addition & 1 deletion source/specifications/name-normalization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ History
=======

- `September 2015 <https://mail.python.org/pipermail/distutils-sig/2015-September/026899.html>`_: normalized name was originally specified in :pep:`503#normalized-names`.
- `November 2015 <https://mail.python.org/pipermail/distutils-sig/2015-November/027868.html>`_: valid non-normalized name was originally specified in :pep:`508#names`.
- `November 2015 <https://mail.python.org/pipermail/distutils-sig/2015-November/027868.html>`_: valid non-normalized name was originally specified in :pep:`508#names`.
4 changes: 0 additions & 4 deletions source/tutorials/creating-documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,3 @@ Other Sources
For a more detailed guide on how to use Sphinx and reStructuredText, please see this `documentation tutorial`_ on Hitchhiker's Guide to Python.

.. _documentation tutorial: https://docs.python-guide.org/writing/documentation/




3 changes: 1 addition & 2 deletions source/tutorials/packaging-projects.rst
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ if you'd like.
# Example Package
This is a simple example package. You can use
[Github-flavored Markdown](https://guides.github.com/features/mastering-markdown/)
[GitHub-flavored Markdown](https://guides.github.com/features/mastering-markdown/)
to write your content.
Expand Down Expand Up @@ -517,4 +517,3 @@ some things you can do:
:ref:`pdm`, and :ref:`poetry`.
* Read :pep:`517` and :pep:`518` for background and details on build tool configuration.
* Read about :doc:`/guides/packaging-binary-extensions`.

0 comments on commit c44afaf

Please sign in to comment.