Move docformatter options from Makefile to pyproject.toml#2072
Conversation
| FLAKEHEAVEN_FILES=$(PROJECT) doc/conf.py examples | ||
| FORMAT_FILES=$(PROJECT) doc/conf.py examples | ||
| LINT_FILES=$(PROJECT) doc/conf.py | ||
| BLACKDOC_OPTIONS=--line-length 79 |
There was a problem hiding this comment.
Apparently blackdoc supports configuration in pyproject.toml since v0.2 on 1 Oct 2020, though it's not well documented. See keewis/blackdoc#40 and https://github.com/keewis/blackdoc/pull/45/files.
So we could remove this BLACKDOC_OPTIONS line in the Makefile, and add the config to pyproject.toml like so:
[tool.blackdoc]
line-length=79There was a problem hiding this comment.
Yes, blackdoc supports pyproject.toml, but I don't think you change works, because line-length should be put in the [tool.black] section (see https://blackdoc.readthedocs.io/en/latest/options.html).
So, line-length in the [tool.black] section will affect both black and blackdoc.
There was a problem hiding this comment.
The blackdoc documentation is wrong/incomplete I think, I tried adding line-length=70 under tool.blackdoc and it works to format only the docstring when I run make format. The line-length for the regular code lines (controlled by tool.black) remains at 88.
There was a problem hiding this comment.
OK. I'll try it later, but perhaps better to do it in a separate PR instead.
There was a problem hiding this comment.
Sure, let's do blackdoc in a separate PR. The changes here are good for docformatter.
…pingTools#2072) * Move docformatter options from Makefile to pyproject.toml * Rename BLACK_FILES, DOCFORMATTER_FILES, and FLAKEHEAVEN_FILES to FORMAT_FILES
Description of proposed changes
docformatter started to support storing options in pyproject.toml since v1.5.0 ( PyCQA/docformatter#77).
This PR moves docformatter options from Makefile to pyproject.toml.
However, docformatter v1.5.0 is still not available in the conda-forge channel yet (see conda-forge/docformatter-feedstock#4), so keep this PR in draft mode.Reminders
make formatandmake checkto make sure the code follows the style guide.doc/api/index.rst.Slash Commands
You can write slash commands (
/command) in the first line of a comment to performspecific operations. Supported slash commands are:
/format: automatically format and lint the code/test-gmt-dev: run full tests on the latest GMT development version