numpydoc icon indicating copy to clipboard operation
numpydoc copied to clipboard

Exclude Files in Test Modules from Numpydoc Validation

Open RNKuhns opened this issue 2 years ago • 0 comments

I love the ability to include the numpydoc validations in my pre-commit routine.

Sorry, I got busy and couldn't help with testing.

As I've been implementing the validations as a pre-commit routine I realized I'm having trouble coming up with a pattern to exclude my test files in the "exclude" option in my pyproject.toml.

I want to exclude any object in a "tests" directory from validation.

I've succeeded by doing this in the .pre-commit-config.yaml file (as shown below). But do you have any suggestions on how I get that to work in the pre-commit routine and specify it in the pyproject.toml configuration?

  - repo: https://github.com/numpy/numpydoc
    rev: v1.6.0rc2
    hooks:
      - id: numpydoc-validation
        exclude: |
          (?x)(
              /tests/|
              docs/source
          )

RNKuhns avatar Aug 24 '23 23:08 RNKuhns