Otherwise, if someone wants to move a definition/extract a superclass from there to
a brand-new package, e.g. from main.py to pkg/mod.py, a namespace "pkg" package will
be created.
Restore the original behavior of PyExtractSuperclassTest.testMultifileNew: the origin
file was inside a regular project root without __init__.py alongside.
GitOrigin-RevId: 750414b18582740076c14bfcfd07fa38992b4428
Now they all just compare the resulting test project content with an explicit "after" directory
instead of checking individual files in the test code.
GitOrigin-RevId: cff00d0a6b8ea4547b719997716e95a3f7c62cc9
Namely, Move Module Members, Extract Superclass and Make Local Function Top-Level were
all affected by this.
Now we check if the refactoring origin is inside a namespace package to decide whether
__init__.py should be generated for target directories.
Co-authored-by: Kamalia <alishevakamalia@gmail.com>
Co-authored-by: Maksim.Levitskii <maksim.levitskii@jetbrains.com>
GitOrigin-RevId: b0b3420c5ec8d1f7d3000d8834211631690a0c42
* Dependency info may be lost when new member is created, so we store it on PSI level
* Support target reference dependency
* Method can't be abstract when property depends on it
GitOrigin-RevId: 24b9b64ef4ce60dd19bc4696e1d7aabf6a260067
On the whole, we don't touch these blank lines (as opposed to deleting
them previously) unless they exceed the limit specified in settings
(Keep maximum blank lines in declarations).
If someone wants to always put a blank line before the first method,
as in PY-1765, they can use this new option.
* `pass` is consistently inserted on the new line now
* excess spaces left after element was deleted are removed
Use PyUtil#deleteElementSafely in pull, push and extract superclass
refactoring implementations.
It turned out that all problems with whitespaces left after we moved
function are rooted in awkward implementation of PyFunctionImpl#delete()
that delegated to plain AST manipulation and thus ignored
usual additional reformatting step. I removed it and it's allowed to
clean a lot of test files and remove the code that was added previously
exactly for this purpose in PyMoveSymbolProcessor.
PullUp: Refactored to use Processor on MembersManager
StatementList refactoring
PullUp: processor added
PyExtractSuperClass and PyPullMembersUp refactored and covered with tests.
PyExtractSuperClass and PyPullMembersUp refactored and covered with tests.