This file contains hidden or 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
# A very useful script for giving credit where it is due: by replacing (most) variable names by the authors who wrote them. | |
# Requirements: pip install gitpython | |
# Usage: python3 assign-credits.py <input_file> <output_file> | |
# Example: python3 assign-credits.py ./src/main.py ./src/main-credited.py | |
# NOTE that this is an awful idea with an awful implementation. The "generated" code likely does not work | |
# (e.g. typing stuff is skipped, class attribute names are replaced). The "author" is decided by the current HEAD of git repo, and whoever | |
# defines the variable first will get the credits (hahaa dunno if even this is right). | |
# It is getting late and I am tired of typing so I will let Github Copilot write something for me. |