我正在尝试从 repo 的根目录使用futurize
https://github.com/suchow/Disserate并返回
$ futurize --stage1 **/*.py
RefactoringTool: Skipping implicit fixer: idioms
RefactoringTool: Skipping implicit fixer: ws_comma
RefactoringTool: No files need to be modified.
我知道在assets/schools/Generic/generic.py
(特别是 https://github.com/suchow/Disserate/blob/master/assets/ 中的print ""
中有错误的打印(仅python2
)语句学校/通用/通用.py#L11)。 我可以手动修复它,但我实际上将它用作测试以确保futurize
可以任意深入到大多数不是 python 文件但最终确实有 python 文件的文件结构中。
我使用bash
作为我的 shell,我也尝试了zsh $(futurize --stage1 **/*.py)
,两者都返回不需要修改任何文件。
如果我cd assets/schools/
那么它可以工作:
futurize --stage1 **/*.py
RefactoringTool: Skipping implicit fixer: idioms
RefactoringTool: Skipping implicit fixer: ws_comma
RefactoringTool: Refactored Generic/generic.py
--- Generic/generic.py (original)
+++ Generic/generic.py (refactored)
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+from __future__ import print_function
from docx import Document
@@ -8,7 +9,7 @@
self.document = Document('../assets/word-base/dissertate.docx')
def fill(self):
- print ""
+ print("")
def save(self):
self.document.save('dissertation.docx')
RefactoringTool: Files that need to be modified:
RefactoringTool: Generic/generic.py
所以它一定与递归搜索有关。
更新: futurize --stage1 .
从根目录工作。 也许这应该在文档中更改? 很高兴这样做,但是这不是推荐的默认方法似乎很奇怪(与futurize --stage1 **/*.py
相反……这让我认为它没有包含在文档中是有原因的,尽管我无法理解是什么那是。
最有用的评论
更新:
futurize --stage1 .
从根目录工作。 也许这应该在文档中更改? 很高兴这样做,但是这不是推荐的默认方法似乎很奇怪(与futurize --stage1 **/*.py
相反……这让我认为它没有包含在文档中是有原因的,尽管我无法理解是什么那是。