I'm trying to use futurize
https://github.com/suchow/Dissertate from the root directory of the repo and it returns
$ futurize --stage1 **/*.py
RefactoringTool: Skipping implicit fixer: idioms
RefactoringTool: Skipping implicit fixer: ws_comma
RefactoringTool: No files need to be modified.
I know there are bad print (python2
only) statements within assets/schools/Generic/generic.py
(specifically print ""
in https://github.com/suchow/Dissertate/blob/master/assets/schools/Generic/generic.py#L11 ). I could fix it manually, but I was actually using this as a test to make sure that futurize
could reach arbitrarily deep into the file structure that is mostly not python files, but does have python files eventually.
I'm using bash
as my shell, and I tried zsh $(futurize --stage1 **/*.py)
as well, and both return that no files need to be modified.
If I cd assets/schools/
then it works:
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
So it must be something having to do with the recursive search.
Update: futurize --stage1 .
works from the root directory. Perhaps this should be changed in the documentation? Happy to do so, but it seems odd that this isn't the recommended default method(as opposed to futurize --stage1 **/*.py
…which makes me think that it was not included in the docs for a reason, though I cannot fathom what that was.
Most helpful comment
Update:
futurize --stage1 .
works from the root directory. Perhaps this should be changed in the documentation? Happy to do so, but it seems odd that this isn't the recommended default method(as opposed tofuturize --stage1 **/*.py
…which makes me think that it was not included in the docs for a reason, though I cannot fathom what that was.