1+ from gitevo import GitEvo , ParsedCommit
2+
3+
4+ remote = 'https://github.com/pallets/flask'
5+
6+ evo = GitEvo (repo = remote , extension = '.py' )
7+
8+ @evo .metric ('loc' , show_version_chart = False )
9+ def loc (commit : ParsedCommit ):
10+ return commit .loc
11+
12+ @evo .metric ('lambda' , show_version_chart = True )
13+ def count_dynamic_features (commit : ParsedCommit ):
14+ return commit .count_nodes ('lambda' )
15+
16+ @evo .metric ('list_comprehension' , show_version_chart = True )
17+ def count_dynamic_features (commit : ParsedCommit ):
18+ return commit .count_nodes ('list_comprehension' )
19+
20+ @evo .metric ('dictionary_comprehension' , show_version_chart = True )
21+ def count_dynamic_features (commit : ParsedCommit ):
22+ return commit .count_nodes ('dictionary_comprehension' )
23+
24+ @evo .metric ('set_comprehension' , show_version_chart = True )
25+ def count_dynamic_features (commit : ParsedCommit ):
26+ return commit .count_nodes ('set_comprehension' )
27+
28+ @evo .metric ('generator_expression' , show_version_chart = True )
29+ def count_dynamic_features (commit : ParsedCommit ):
30+ return commit .count_nodes ('generator_expression' )
31+
32+ @evo .metric ('yield' , show_version_chart = True )
33+ def count_dynamic_features (commit : ParsedCommit ):
34+ return commit .count_nodes ('yield' )
35+
36+ evo .run ()
0 commit comments