ColossalAI icon indicating copy to clipboard operation
ColossalAI copied to clipboard

[PROPOSAL]: Increase the usage of augmented assignment statements

Open elfring opened this issue 3 years ago • 2 comments

Proposal

:eyes: Some source code analysis tools can help to find opportunities for improving software components. :thought_balloon: I propose to increase the usage of augmented assignment statements accordingly.

Would you like to integrate anything from a transformation result which can be generated by a command like the following? (:point_right: Please check also for questionable change suggestions because of an evolving search pattern.)

lokal$ perl -p -i.orig -0777 -e 's/^(?<indentation>\s+)(?<target>\S+)\s*=\s*\k<target>[ \t]*(?<operator>[+%^@]|-(?!>)|&(?!&)|\|(?!\|)|\*\*?|\/\/?|<<|>>)/$+{indentation}$+{target} $+{operator}=/gm' $(find ~/Aktivitäten/Colossal-AI/lokal -name '*.py')

:crystal_ball: How will the development interests evolve further also according to update candidates in 194 lines of this software?

Self-service

  • [ ] I'd be willing to do some initial work on this proposal myself.

elfring avatar Nov 23 '22 12:11 elfring

Hi @elfring Thank you for the interesting proposal. Would you please submit a PR to point this out with some examples? We very much welcome contributions from the open source community, thanks.

binmakeswell avatar Nov 24 '22 05:11 binmakeswell

:thought_balloon: Would you dare to perform a source code search and corresponding replacements in another development repository with the help of the shown Perl command example?

elfring avatar Nov 24 '22 07:11 elfring

We have updated a lot. This issue was closed due to inactivity. Thanks.

binmakeswell avatar Apr 14 '23 08:04 binmakeswell