<#21306 Conflict between docformatter --check and ...
# github-notifications
c
#21306 Conflict between docformatter --check and --in-place options when using Pants Issue created by 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:
Copy code
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`:
Copy code
[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? pantsbuild/pants