Skip to content

Exclude Files in Test Modules from Numpydoc Validation #497

Open
@RNKuhns

Description

@RNKuhns

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
          )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions