pydocstyle can be included as a hook for pre-commit. The easiest way to get started is to add this configuration to your .pre-commit-config.yaml:

-   repo: https://github.com/pycqa/pydocstyle
    rev: 6.1.1  # pick a git hash / tag to point to
    hooks:
    -   id: pydocstyle

See the pre-commit docs for how to customize this configuration.

Checked-in python files will be passed as positional arguments so no need to use --match=*.py. You can also use command line arguments instead of configuration files to achieve the same effect with less files.

- id: pydocstyle
  args:
  - --ignore=D100,D203,D405
  # or multiline
  - |-
          --select=
          D101,
          D2