-
Notifications
You must be signed in to change notification settings - Fork 51
🔄 synced file(s) with WordPress/openverse #963
Conversation
816669f
to
fc51b7b
Compare
I'm working on addressing the docstring linting. |
f67f638
to
ccc3755
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made all the necessary docstring changes 👍🏼
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for undertaking this Sisyphean task, Madison.
I haven't reviewed all the changes. I honestly hope I (and no one else on the team) don't have to because my recommendation is for us to scrap this linter. I was sceptical in the original issue that it would be a useful tool for us due to how contrived some of the rules are. I was able to get it to a somewhat reasonable state for the WordPress/openverse directory. Seeing it now applied to a larger Python codebase, I am struck by how much useless and absurd noise it forces us to add.
There are a few rules we could disable to ease some of these things. But my biggest gripes are all about the requirement of a "summary" line and there is no way to disable it, not even selectively like just disable it for modules.
I like the imperative mood rule and some other consistency things (especially adding whitespace, etc). I wish pydocstyle allowed disabling required summaries. As it stands, I think it is a bad idea to spend more time trying to make this work for our projects and forcing contributors to add senseless, noisy, useless pieces of documentation that invariably hurt the contribution experience, both for the person being forced to write useless documentation and for the people who have to learn to ignore them like banner ads in the 2000s.
I've gone ahead and approved it, and we can merge it because I figure the worst case is that we can revert this. Merging it now will at least prevent someone from having to re-do this absurd effort in the future if we decide to keep this tool.
@@ -4,6 +4,8 @@ | |||
class GitHubAPI: | |||
def __init__(self, pat: str): | |||
""" | |||
Initialize. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really tedious to have to include 😞 I don't understand why pydocstyle requires a summary for __init__
.
Maybe we should consider ignoring D402, which I believe is what forces this?
@@ -1,4 +1,6 @@ | |||
""" | |||
Provider information. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and the "License utilities." one makes me question the entire endeavour. This kind of thing is the epitome of useless documentation and a linter that forces us to add them feels... like a bad linter.
@@ -1,5 +1,5 @@ | |||
""" | |||
# Slack Block Message Builder | |||
# Slack Block Message Builder. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is yet another silly change to be forced to make 😢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be a difference in the style of documentation but the API docs mostly use sentences and so this comment there would've been "This is a message builder for Slack.", with the full-stop being there by default due to the sentence-like nature of the comments.
Thanks for looking over this @sarayourfriend! I wanted to at least try it to see the breadth of the changes, but similarly I'm frustrated by how the linting adds so much seemingly useless text 😓 I think of the changes I made, the ones I actually enjoyed the products of were:
Rules I could totally do away with:
All that to say, it sounds like we may want to also ignore |
6557114
to
968490d
Compare
8d0ac84
to
e3567ee
Compare
7649f98
to
9ca9bfb
Compare
I made a similar set of changes on the API and for the most part, I feel like a lot of the changes were good and positive for the documentation. It was a bit of hard work to fix all of its complaints but it was a one-time effort. I would recommend keeping this lint check. |
Per discussion in our Make WP chat, we're going to keep the check in general but remove the two rules shared above in the upstream repo. I'll take care of that this week 🙂 |
5350f2c
to
586ae5a
Compare
Okay, rebased with the necessary changes! I kept most of the changes I had made, except for the |
synced local file(s) with WordPress/openverse.
Changed files
.pre-commit-config.yaml
with remotetemplates/.pre-commit-config.yaml.jinja
This PR was created automatically by the repo-file-sync-action workflow run #4069993342