Skip to content

Conflict between docformatter --check and --in-place options when using Pants #21306

Open
@totaln

Description

@totaln

Describe the bug
When using Pants with docformatter, there's a conflict between the --check and --in-place options. Even though only --check is specified in the configuration, the error message suggests that --in-place is being added somewhere in the process. This prevents docformatter from running correctly through Pants.
Specifically, when running:
pants --docformatter-args="--check --diff" lint test.py
The following error is encountered:

ProcessExecutionFailure: Process 'Run Docformatter on 1 file.' failed with exit code 2.
stderr:
docformatter: error: argument -c/--check: not allowed with argument -i/--in-place

Pants version
2.2.1

OS
MacOS

Additional info

  1. Configuration in pants.toml:
[GLOBAL]
pants_version = "2.21.1"
backend_packages.add = [
  "pants.backend.python.lint.docformatter",
  # ... other backends ...
]


[docformatter]
args = ["--check", "--diff"]
  1. Running docformatter directly on the file works as expected.
  2. Attempts to resolve:
    Explicitly added --no-in-place to the args in pants.toml.
    Updated Pants to the latest version (2.21.1).
    Checked for conflicting configurations in other files.
  3. Questions:
    Why is the--in-place option being added when not specified?
    How can this conflict be resolved by running docformatter with --check through Pants?
    Is there a known issue with docformatter integration in Pants 2.21.1?

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions