Zac-HD / shed

`shed` canonicalises Python code. Shed your legacy, stop bikeshedding, and move on. Black++
https://pypi.org/project/shed/
GNU Affero General Public License v3.0
343 stars 23 forks source link

Possible typo in CODEMODS.md #108

Closed EFord36 closed 6 months ago

EFord36 commented 6 months ago

Hi,

While reading through CODEMODS.md, I noticed two lines in the replace_unnecessary_nested_calls section that are identical, in a way that seems unintentional.

I think maybe there was a typo of True for False here (based on the following two lines), but could easily be wrong - I thought about opening this as an issue instead of a PR, but I believe there's some reasonable chance my change is appropriate, and it's low-cost if it's wrong (I'm happy if you say 'ah yes, there is a problem, you've fixed it wrong, I've fixed it myself, closing this PR).

EFord36 commented 6 months ago

I've just updated my branch - I agree sorted(sorted(iterable), reverse=True) makes more sense so changed to that.

I also realised the same lines are present in tests/recorded/comprehensions/C414.txt so I changed it there too.

(Annoyingly, GitHub is behaving strangely for me currently and shows no updates, only a 'processing updates' spinner at the top of the PR:

Screenshot 2024-04-10 at 10 21 54

I assume this is a GitHub problem that will resolve - I can see the commit is updated if I click through to my branch and view the diff with upstream.)

jakkdl commented 6 months ago

oh, I probably just copy-pasted the lines from the tests to the doc.

I'm seeing the same spinner and no update. You could try adding an empty commit (git commit --allow-empty) and we'll squash the PR.

(I'd generally recommend having multiple commits instead of amending and force-pushing regardless, it's less dangerous if others might be working on the same branch, and allows reviewers of a PR to be able to only review new changes in the github interface. Though don't know if that would've avoided github being weird here.)

EFord36 commented 6 months ago

Good suggestion, all looking good now!

Yes, I think I'm in bad habits there with force-pushing 😬