Skip to content

Unpin docformatter 1.5.1 #2538

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

Merged
merged 5 commits into from
Jun 7, 2023
Merged

Unpin docformatter 1.5.1 #2538

merged 5 commits into from
Jun 7, 2023

Conversation

weiji14
Copy link
Member

@weiji14 weiji14 commented May 15, 2023

Description of proposed changes

Docformatter=1.7.0 has a --black option to make it compatible with the black linter. Also updated a few docstrings in the unit test where docformatter tried to capitalize the first letter.

Thanks @seisman for checking the docformatter 1.7.0 RC releases too at PyCQA/docformatter#199!

Reverts #2482, resolves #2476.

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst.
  • Write detailed docstrings for all functions/methods.
  • If wrapping a new module, open a 'Wrap new GMT module' issue and submit reasonably-sized PRs.
  • If adding new functionality, add an example to docstrings or tutorials.
  • Use underscores (not hyphens) in names of Python files and directories.

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash commands are:

  • /format: automatically format and lint the code
  • /test-gmt-dev: run full tests on the latest GMT development version

Docformatter=1.7.0 has a `--black` option to make it compatible with the black linter. Also updated a few docstrings in the unit test where docformatter tried to capitalize the first letter.
@weiji14 weiji14 added maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog labels May 15, 2023
@weiji14 weiji14 added this to the 0.10.0 milestone May 15, 2023
@weiji14 weiji14 self-assigned this May 15, 2023
@weiji14 weiji14 marked this pull request as ready for review May 17, 2023 05:40
@weiji14 weiji14 marked this pull request as draft May 23, 2023 21:09
@weiji14
Copy link
Member Author

weiji14 commented May 23, 2023

Yeah, let's keep docformatter pinned to 1.5.1 for a while. The latest docformatter=1.7.1 is removing some newlines from the .py files under examples/. E.g.

diff --git a/examples/gallery/histograms/scatter_and_histograms.py b/examples/gallery/histograms/scatter_and_histograms.py
index 2c414f7e7..872b4e0d1 100644
--- a/examples/gallery/histograms/scatter_and_histograms.py
+++ b/examples/gallery/histograms/scatter_and_histograms.py
@@ -1,11 +1,11 @@
 """
-Scatter plot with histograms
-----------------------------
-To create a scatter plot with histograms at the sides of the plot one
-can use :meth:`pygmt.Figure.plot` in combination with
-:meth:`pygmt.Figure.histogram`. The positions of the histograms are plotted
-by offseting them from the main scatter plot figure using
-:meth:`pygmt.Figure.shift_origin`.
+Scatter plot with histograms ---------------------------- To create a scatter
+plot with histograms at the sides of the plot one can use
+:meth:`pygmt.Figure.plot` in combination with :meth:`pygmt.Figure.histogram`.
+
+The positions of the histograms are plotted by offseting them from the main
+scatter plot figure using
+:meth: `pygmt.Figure.shift_origin`.
 """
 
 import numpy as np
diff --git a/examples/projections/azim/azim_equidistant.py b/examples/projections/azim/azim_equidistant.py
index 2b75b9266..bee76ffcd 100644

Looking at https://github.com/PyCQA/docformatter/issues, it looks like they're sorting out some issues with whitespace and newlines, so give them a few days.

@weibullguy
Copy link

Also updated a few docstrings in the unit test where docformatter tried to capitalize the first letter.

FYI, there is a --non-cap argument that takes a list of words to not capitalize when they appear as the first word in the summary. Thus:

docformatter --non-cap grdcut grdproject psconvert <List of files>

shouldn't capitalize those words in your docstrings. Or set this list in your pyproject.toml:

[tool.docformatter]
black = true
recursive = true
pre-summary-newline = true
make-summary-multi-line = true
non-cap = [
	"grdcut",
        "grdproject",
        "psconvert",
]

@weiji14 weiji14 marked this pull request as ready for review June 7, 2023 08:16
@weiji14
Copy link
Member Author

weiji14 commented Jun 7, 2023

Style checks passing now with docformatter=1.7.2 (thanks @weibullguy for pushing out the patch release!). Made a small edit to remove some whitespaces at ddade3e.

Skip docformatter=1.7.1 as it was a bit buggy, see docformatter=1.7.2 release notes at https://github.com/PyCQA/docformatter/releases/tag/v1.7.2.
@weiji14 weiji14 merged commit 6c69fb6 into main Jun 7, 2023
@weiji14 weiji14 deleted the docformatter-1.7.0 branch June 7, 2023 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docformatter v1.6.0 is incompatible with black
3 participants