Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combining --config and --in-place to resolve issues does not use configuration #112

Closed
fmigneault opened this issue Aug 19, 2022 · 2 comments · Fixed by #111
Closed

Combining --config and --in-place to resolve issues does not use configuration #112

fmigneault opened this issue Aug 19, 2022 · 2 comments · Fixed by #111
Labels
C: stakeholder Relates to docformatter stakeholder requested behavior P: docs Problem with docformatter documentation

Comments

@fmigneault
Copy link

I run the following command and everything is reported as "OK" :

docformatter \
	--pre-summary-newline \
	--wrap-descriptions 0 \
	--wrap-summaries 120 \
	--make-summary-multi-line \
	--in-place \
	--recursive \
	. 

Converting to the following:

docformatter \
	--in-place \
	--recursive \
	--config setup.cfg \
	. 

And using setup.cfg:

[tool.docformatter]
recursive = true
wrap-descriptions = 0
wrap-summaries = 120
make-summary-multi-line = true
pre-summary-newline = true

I get many changes mostly ignoring make-summary-multi-line.
When I provide this parameter again in combination to --config, then fixes have the newlines again, but not the wrap-summaries = 120 (use default instead).

Running the same command with --config and replacing --in-place by --check reports everything is "OK" again, so this one considers the configuration file.

@github-actions github-actions bot added the fresh This is a new issue label Aug 19, 2022
@fmigneault
Copy link
Author

fmigneault commented Aug 20, 2022

Update
Seems to be an issue with [tool.docformatter]. (supposed to be a : instead of . ?)
I replaced the section by [docformatter] and it works as expected.
The doc is misleading for setup.cfg.

fmigneault added a commit to crim-ca/weaver that referenced this issue Aug 20, 2022
@weibullguy weibullguy added chore Boring, but important, stuff P: docs Problem with docformatter documentation C: stakeholder Relates to docformatter stakeholder requested behavior and removed fresh This is a new issue chore Boring, but important, stuff labels Aug 20, 2022
@weibullguy
Copy link
Member

This sounds like a documentation only issue. There are two pieces of information missing or in error in the current documentation.

  1. Command line arguments take precedence over configuration file values.
  2. If using setup.cfg, the [docformatter] heading is the correct heading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: stakeholder Relates to docformatter stakeholder requested behavior P: docs Problem with docformatter documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants