Mass Refactoring

Mass refactoring ( P42 Pro) allows you to quickly modernize hundreds and thousands of files.

For files and folders in the Explorer, there is a "Mass Refactor... [P42 Pro]" command that refactors files and folders in one go. You can choose a refactoring from a dialog. The selected file or all files in the folder (and its subfolders) are then refactored with the chosen refactoring. This means that all suggestions that this refactoring produces are applied.

šŸ’”Ā Ā You can configure excluded path patterns to prevent specific folders and files from being updated by a mass refactoring.

Recommended Workflow

  1. Get your workspace in a clean state, e.g., by committing or stashing your current changes or by switching to a clean branch.
  2. Run the refactoring on the folders you want to update.
  3. Thoroughly review the individual changes in the diff viewer and revert or fix them as needed. Modernizations need to cover many edge cases, so there is a chance that some changes may lose comments, break formatting, or affect the semantics. The P42 output log will also contain warnings for unsafe refactorings (see Safety Analysis). If you find bugs, please report them here:
  4. Run your test suites to ensure nothing broke unexpectedly.
  5. Commit the changes.

Mass Refactoring Command