Skip to content

Add another docstring formatter in pre-commit#5629

Merged
Pierre-Sassoulas merged 2 commits intopylint-dev:mainfrom
DanielNoord:docstring
Jan 2, 2022
Merged

Add another docstring formatter in pre-commit#5629
Pierre-Sassoulas merged 2 commits intopylint-dev:mainfrom
DanielNoord:docstring

Conversation

@DanielNoord
Copy link
Collaborator

  • Add yourself to CONTRIBUTORS if you are a new contributor.
  • Write a good description on what the PR does.

Type of Changes

Type
🔨 Refactoring

Description

@Pierre-Sassoulas Just to show off the new program I wrote. It is somewhat nitpicky, but would save time in review. Repository can be found here.
Let me know if this is something you would want to merge or if anything is missing!

@DanielNoord DanielNoord added the Maintenance Discussion or action around maintaining pylint or the dev workflow label Jan 2, 2022
@coveralls
Copy link

coveralls commented Jan 2, 2022

Pull Request Test Coverage Report for Build 1647217961

  • 17 of 17 (100.0%) changed or added relevant lines in 17 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 93.708%

Totals Coverage Status
Change from base Build 1644685548: 0.01%
Covered Lines: 14341
Relevant Lines: 15304

💛 - Coveralls

@DanielNoord DanielNoord changed the title Docstring Add another docstring formatter in pre-commit Jan 2, 2022
Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good ! Would you mind checking the updated #5624 ? I removed docformatter and applied pydocstringformatter. I've done some (hundreds 😄) manual fixes here, I'd like them to be added if possible. But I think there's some case where pydocstringformatter do not fix some issue see https://github.com/PyCQA/pylint/pull/5624/files#diff-35d3c5349e5876e9820da739cbefc979ef433a55ab338df84cae9e2cd1b0d0c2R6 for example.

@DanielNoord
Copy link
Collaborator Author

I fixed the issue with module docstrings not getting recognised.

I have got some other things I would like to put in 0.2.0 so I haven't released it yet, but that should be good to go somewhere the coming days. I'll use this PR to update to 0.2.0. After that I can look at #5624. If my program works the only thing that should remain in that PR are your manual fixes 😄

@Pierre-Sassoulas
Copy link
Member

To be noted that when we add it's going to be independent, there will be a an automatic upgrade if you release a version of pydocstringformatter by the pre-commit bot without us doing anything about it. It's still a good idea to wait a little so we don't have too much formatting related changes when upgrading.

Also maybe a cool name would be nice ? 😄 It's similar to black so something with color ? It's a shame that 257 is too high for RGB and PEP too high for hex code, but #FEF257 is close enough and is a light yellow, so maybe lemon, custard, golden or chanteclerc 😉

fef257

@DanielNoord
Copy link
Collaborator Author

To be noted that when we add it's going to be independent, there will be a an automatic upgrade if you release a version of pydocstringformatter by the pre-commit bot without us doing anything about it. It's still a good idea to wait a little so we don't have too much formatting related changes when upgrading.

Indeed! I think the current dev version is good enough for us, but I'd like to add some better options registering for potential other users.

Also maybe a cool name would be nice ? 😄 It's similar to black so something with color ? It's a shame that 257 is too high for RGB and PEP too high for hex code, but #FEF257 is close enough and is a light yellow, so maybe lemon, custard, golden or chanteclerc 😉

fef257

I'm open to good suggestions, I think chanteclerc is quite good 😄

@Pierre-Sassoulas
Copy link
Member

(Chanteclerc is a variety of yellow apples.) Though I realized that basically every pep would be very close in color to each other with this 'pep to hex' reasoning.

Another possibility is checking what happened in 257 (a lot had to do with Valerian, which sounds Nice) or 257 bc (Tyndaris, sounds nice too). https://en.m.wikipedia.org/wiki/257_BC.

@DanielNoord
Copy link
Collaborator Author

@Pierre-Sassoulas Updated to 0.2.0. That should fix the issue you identified and also format single line docstrings a little better. I force pushed to create a sane commit history, we should now be able to rebase and merge this.

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's pretty nice 👍

@Pierre-Sassoulas Pierre-Sassoulas merged commit fffde57 into pylint-dev:main Jan 2, 2022
@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.13.0 milestone Jan 2, 2022
@DanielNoord DanielNoord deleted the docstring branch January 2, 2022 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation 📗 Maintenance Discussion or action around maintaining pylint or the dev workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants