Skip to content

Documentation shows incorrect pre-commit configuration when using pyproject.toml #172

Description

@balazser

I am trying to use the docformatter hook with pre-commit to format my Python code. However, I am encountering an issue where the docformatter hook does not respect the configuration in my pyproject.toml file when run through pre-commit, but it does respect the configuration when run manually with poetry.

Specifically, I have the following configuration for the docformatter hook in my .pre-commit-config.yaml file:

bash

- repo: https://github.com/PyCQA/docformatter
  rev: v1.5.0
  hooks:
    - id: docformatter
      args: ["--in-place", "--config", "./pyproject.toml"]

However, when I run pre-commit run --all-files docformatter, docformatter seems to ignore the configuration in pyproject.toml and uses its default settings instead. On the other hand, when I run poetry run docformatter ., docformatter correctly uses the settings in pyproject.toml.

Can someone explain why this might be happening, and how I can get docformatter to respect my pyproject.toml configuration when run through pre-commit?

Thank you.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P: docsProblem with docformatter documentation

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions