Please suggest a way to auto format all py files in an eclipse project using pydev auto code format. We're using the pydev code formatter to make our code consistent and would really like to get all files standardized.
Since we've enabled code formatting in pydev, every time a py file is touched by pydev, it gets changed at many places only due to code formatting cleanup. We'd like to do it across the project in one sweep.
Thanks
To format your whole script: Open the required file. Go to Source | Format Document or press Ctrl+Shift+F.
Importing preferences for automatic formatting. Eclipse has the capability to do so some automatic formatting whenever a file that is being edited is saved.
Although auto-indentation is not a feature of PyDev because of the language design you should be able to indent with a simple tab. Just select the lines you want to indent and press Tab. If you want to unindent lines you have to press Shift+Tab. Thats all.
Eclipse has a default Java code formatting profile, known as Eclipse [built-in], which it uses to format code every time you press the combination keys Ctrl + Shift + F (on Windows) and ⌘ + ⇧ + F (on Mac).
You can apply code-formatting to all the files within a project/folder.
To do that, right-click a project/folder and select pydev > source format python files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With