如何进行代码的"自动化重构"
例如: 如何修改一下代码的方法名及其的调用?
#!/usr/bin/env python
def test():
test = 'test()'
print test[:-2]
test()
注:
1. IDE一般都有这样的功能, 这里希望的是自动化完成批量的操作.
2. 这里不考虑正则之类的方法, 例如代码中的同名字符串很容易会被替换掉.
3. 题主的实践是使的用python-rope [https://github.com/python-rope/rope]
来重构, 但是只找到修改变量的方法. 有没有有经验的提供一下方法或者其他类似工具.
4. 不一定局限于python 重构其他语言的工具也可以分享一下.
5. 这里的"自动化重构"是指, 不需要我手动进行操作. 当我编写好重构规则, 即可批量对某些项目进行重构. 类似python-rope
使用自动化重构类
python-rope [https://github.com/python-rope/rope]
使用headless IDE
eclim
https://github.com/ervandew/eclim