0

I am using 2to3 to update some python2 code. Unfortunately there is some fixers I do not like:

  • There are some fixers I do trust (like the print fixer).
  • So I would like to only run one the fixers I trust.

For Python 2to3, how do you disable all fixers and only do one or two fixers? For example if you just want to run print fixer"?

martineau
  • 119,623
  • 25
  • 170
  • 301
Trevor Boyd Smith
  • 18,164
  • 32
  • 127
  • 177

1 Answers1

0

You just have to do:

2to3 --fix print your_file.py
  • I misread the documentation.
  • When you provide no --fix, then all fixers are enabled.
  • If you provide one or more --fix then only those fixers you specify are processed.
  • When you provide --nofix and no --fix, then all fixers are enabled and only the fixers you specify with --nofix are disabled.
Trevor Boyd Smith
  • 18,164
  • 32
  • 127
  • 177