Skip to content

docstring_linter: Fix #151692 and other issues #156596

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

Open
wants to merge 11 commits into
base: gh/rec/156/base
Choose a base branch
from

Conversation

rec
Copy link
Collaborator

@rec rec commented Jun 23, 2025

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Jun 23, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/156596

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 20063b1 with merge base ff0d56d (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot pytorch-bot bot added the topic: not user facing topic category label Jun 23, 2025
@rec rec requested a review from Skylion007 June 23, 2025 12:43
@rec rec added the module: lint Issues related to our Python/C++ lint rules (run by Travis) label Jun 23, 2025
@rec
Copy link
Collaborator Author

rec commented Jun 23, 2025

The postmortem as to how I thought I fixed this issue but didn't is a bit embarrassing.

I wrote code to extract decorators and query for @override and wrote a "test"
for that
but I didn't hook it up to the actual place where I test if a docstring is necessary.

The test didn't fail because of another latent issue - when I counted the lines in a method or class, I started on the first indent after the definition, which did not include any introductory comments starting with #, so the method appeared short enough not to need a docstring!

I changed the definition of the length of a class or method to include the class or def statement, but not any blank lines after the class, function or method. This is more realistic, but tended to make everything a bit longer, so I increased the acceptable lengths in the test harness as well.

(I also simplified the code for detecting overrides, because I didn't trust it, even though it turned out to be fine.)

[ghstack-poisoned]
rec added a commit that referenced this pull request Jun 23, 2025
ghstack-source-id: 6cffca1
Pull Request resolved: #156596
@rec rec marked this pull request as ready for review June 23, 2025 14:53
[ghstack-poisoned]
rec added a commit to rec/pytorch that referenced this pull request Jun 23, 2025
ghstack-source-id: 0430908
Pull Request resolved: pytorch#156596
[ghstack-poisoned]
rec added a commit that referenced this pull request Jun 23, 2025
ghstack-source-id: 3ec0f62
Pull Request resolved: #156596
[ghstack-poisoned]
[ghstack-poisoned]
rec added a commit that referenced this pull request Jun 24, 2025
ghstack-source-id: 7304907
Pull Request resolved: #156596
[ghstack-poisoned]
rec added a commit that referenced this pull request Jul 4, 2025
ghstack-source-id: 5c227fc
Pull Request resolved: #156596
@rec
Copy link
Collaborator Author

rec commented Jul 4, 2025

@Skylion007 Updated!

[ghstack-poisoned]
rec added a commit that referenced this pull request Jul 28, 2025
ghstack-source-id: 71f2de6
Pull Request resolved: #156596
@rec
Copy link
Collaborator Author

rec commented Jul 30, 2025

@Skylion007 Updated!

@rec rec requested a review from eellison August 1, 2025 10:55
@rec
Copy link
Collaborator Author

rec commented Aug 1, 2025

@eellison Fixes a little bug that has to be a quality of life issue for at least some of the people working on inductor...

@rec
Copy link
Collaborator Author

rec commented Aug 5, 2025

@pytorchbot rebase

@pytorchmergebot
Copy link
Collaborator

@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here

@pytorchmergebot
Copy link
Collaborator

Rebase failed due to Command git -C /home/runner/work/pytorch/pytorch rebase refs/remotes/origin/viable/strict gh/rec/156/orig returned non-zero exit code 1

Rebasing (1/1)
Auto-merging tools/linter/adapters/docstring_linter-grandfather.json
CONFLICT (content): Merge conflict in tools/linter/adapters/docstring_linter-grandfather.json
error: could not apply 27e44452222... docstring_linter: Fix #151692 and other issues
hint: Resolve all conflicts manually, mark them as resolved with
hint: "git add/rm <conflicted_files>", then run "git rebase --continue".
hint: You can instead skip this commit: run "git rebase --skip".
hint: To abort and get back to the state before "git rebase", run "git rebase --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Could not apply 27e44452222... # docstring_linter: Fix #151692 and other issues

Raised by https://github.com/pytorch/pytorch/actions/runs/16750206703

[ghstack-poisoned]
rec added a commit that referenced this pull request Aug 5, 2025
ghstack-source-id: 9333b92
Pull Request resolved: #156596
[ghstack-poisoned]
rec added a commit that referenced this pull request Aug 6, 2025
ghstack-source-id: 56b375a
Pull Request resolved: #156596
@rec
Copy link
Collaborator Author

rec commented Aug 7, 2025

@eellison : Updated. The actual code change is small: most of the delta is the acceptance tests.

[ghstack-poisoned]
rec added a commit that referenced this pull request Aug 11, 2025
ghstack-source-id: b58abb0
Pull Request resolved: #156596
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: lint Issues related to our Python/C++ lint rules (run by Travis) open source topic: not user facing topic category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants