@@ -39,6 +39,7 @@ def entry_point():
3939 show_default = True ,
4040 help = 'List all locally defined models (in the current repo) that require annotations.' ,
4141)
42+ @click .option ('--app_name' , default = '' , help = '(Optional) App name for which coverage is generated.' )
4243@click .option ('--report_path' , default = None , help = 'Location to write the report' )
4344@click .option ('-v' , '--verbosity' , count = True , help = 'Verbosity level (-v through -vvv)' )
4445@click .option ('--lint/--no_lint' , help = 'Enable or disable linting checks' , default = False , show_default = True )
@@ -48,6 +49,7 @@ def django_find_annotations(
4849 config_file ,
4950 seed_safelist ,
5051 list_local_models ,
52+ app_name ,
5153 report_path ,
5254 verbosity ,
5355 lint ,
@@ -96,15 +98,17 @@ def django_find_annotations(
9698 click .echo ("Coverage passed without errors." )
9799
98100 if report :
99- searcher .report (annotated_models )
101+ searcher .report (annotated_models , app_name )
100102
101103 annotation_count = 0
102104
103105 for filename in annotated_models :
104106 annotation_count += len (annotated_models [filename ])
105107
106108 elapsed = datetime .datetime .now () - start_time
107- click .echo ("Search found {} annotations in {}." .format (annotation_count , elapsed ))
109+ click .echo ("Search found {} annotations in {} seconds." .format (
110+ annotation_count , elapsed .total_seconds ()
111+ ))
108112
109113 except Exception as exc : # pylint: disable=broad-except
110114 click .echo (traceback .print_exc ())
0 commit comments