-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
addons/namingng.py: Cosmetic overhaul, reduce indents and function le…
…ngth. This patch is (/should be) purely cosmetic, and aims to improve maintainability by reducing indentation, function length and redundant code/comments. The following was done: - put every check in a separate function with the same signature - use args.debugprint instead of function kwarg debugprint - eliminate almost-duplicate code - simplify/remove redundant code, e.g. `if a is None or a != 'Public'` - remove stale or all-too-obvious comments - remove unused arguments - reorder code flow to reduce indentation (`if not a: continue`) - fix recent, minor bug that prevented standalone mode to work properly The results: - the number of "tabs" is reduced by 30% - the maximum indentation depth is now 5, coming from 8 - the longest function is now ~75 lines, coming from ~150 lines - 9 functions were added - a net total of 6 lines of code were removed
- Loading branch information
Showing
1 changed file
with
141 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters