Skip to content
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

PR: Removed unused __init__() methods #655

Merged
merged 6 commits into from Feb 6, 2023
Merged

PR: Removed unused __init__() methods #655

merged 6 commits into from Feb 6, 2023

Conversation

edreamleo
Copy link
Contributor

@edreamleo edreamleo commented Feb 4, 2023

The _GlobalVisitor class is an alias of its base class, _ScopeVisitor.

Only dpo.PyModule.__init__ references _ScopeVisitor.

The reference is: self.visitor_class = _GlobalVisitor

_GlobalVisitor.__init__ is unnecessary, and is unlikely ever to be necessary.

The only "real" diff should be to rope/base/pyobjectsdef.py.

The spurious diffs should disappear once PR #656 is merged into master and this branch.

@edreamleo
Copy link
Contributor Author

edreamleo commented Feb 4, 2023

Question: If the black-related checks passed this branch, why did those same checks pass master?

Answer: recent commits to master also fail.

@edreamleo

This comment was marked as outdated.

@edreamleo
Copy link
Contributor Author

edreamleo commented Feb 4, 2023

@lieryan There might be a simple explanation:

  • From gitk it looks like you might not have pushed to master in about 10 days.
  • Perhaps the GitHub actions mandated a later version of black in the interval.
    I had to upgrade black myself several days back to make the black tests pass.
  • You are now as surprised as I was several days ago.

Just a guess. Anyway, this version of black passes muster on Windows 11:

python.exe -m black --version
python -m black, 23.1.0 (compiled: yes)
Python (CPython) 3.10.5

@edreamleo
Copy link
Contributor Author

edreamleo commented Feb 4, 2023

I'll reissue this PR once PR #656 is merged into master.
No need to do that. I'll just merge master into this branch.

@lieryan
Copy link
Member

lieryan commented Feb 5, 2023

Committer, author, and pusher are three separate concept in Git.

I authored and committed 88e2d68, but you pushed the commit to your fork when you synced your fork with the mainline repository.

So the notification seems accurate, albeit a bit confusing if you don't make the distinction.

Github Action seems to use its own upstream version of black. It's not surprising that the formatting changes, since rope pins to an older, patched branch of black that handles dedent()-ed string better. I don't think we pinned the GHA black, so some differences over time would be expected there until black merged the dedent branch.

I'll look into if there's a way to avoid this issues, maybe by pinning GHA black or something.

@edreamleo
Copy link
Contributor Author

@lieryan Thanks for your comments.

I'll continue to use 23.1.0 for now. I see that .pre-commit-config.yaml specifies black 22.12.0.

I'm glad you're on this. GitHub actions remains mysterious to me :-)

@lieryan lieryan changed the title PR: Removed unused _GlobalVisitor.__init__ PR: Removed unused __init__() methods Feb 6, 2023
@lieryan lieryan merged commit e0cd8a1 into python-rope:master Feb 6, 2023
@edreamleo
Copy link
Contributor Author

@lieryan Thanks for generalizing this PR to other classes.

@lieryan lieryan added this to the 1.8.0 milestone Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants