Skip to content

Refactoring Guideline

Yang Ding edited this page Jun 23, 2021 · 1 revision

Please ensure to not manually refactor. Try to utilize tools such as PyCharm refactoring process to avoid issues, even though it is not perfect.

The follow changes are considered valid refactoring PR components:

  1. Renaming functions/variables
  2. Creating new keywords/constants in place of magic string/numbers
  3. Adding type hinting
  4. Adding comments
  5. Additional import statement (local or global) to avoid circular reference.
  6. Moving classes out of existing modules
  7. Creating new functions that replaces existing chunk of code

Introducing new functionalities (beside refactored new functions, i.e. new feature or bug fixes) are strongly discouraged as they can make the review process very challenging and making PR not modular enough. You are welcome to make those radical changes on your own branch and cry about difficulty of getting it merged down the road but do it at your own perils.

IF it is absolutely needed to address some major critical bug found during refactoring, it is the PR author's responsibility to CLEARLY identify such cases to make reviewers aware of these changes.