Compute tallies of a scan at the codebase level for only key files.
| 289 | |
| 290 | @post_scan_impl |
| 291 | class KeyFilesTallies(PostScanPlugin): |
| 292 | """ |
| 293 | Compute tallies of a scan at the codebase level for only key files. |
| 294 | """ |
| 295 | run_order = 150 |
| 296 | sort_order = 150 |
| 297 | |
| 298 | # mapping of tally data at the codebase level for key files |
| 299 | codebase_attributes = dict(tallies_of_key_files=attr.ib(default=attr.Factory(dict))) |
| 300 | |
| 301 | options = [ |
| 302 | PluggableCommandLineOption(('--tallies-key-files',), |
| 303 | is_flag=True, default=False, |
| 304 | help='Compute tallies for license, copyright and other scans for key, ' |
| 305 | 'top-level files. Key files are top-level codebase files such ' |
| 306 | 'as COPYING, README and package manifests as reported by the ' |
| 307 | '--classify option "is_legal", "is_readme", "is_manifest" ' |
| 308 | 'and "is_top_level" flags.', |
| 309 | help_group=POST_SCAN_GROUP, |
| 310 | required_options=['classify', 'tallies'] |
| 311 | ) |
| 312 | ] |
| 313 | |
| 314 | def is_enabled(self, tallies_key_files, **kwargs): |
| 315 | return tallies_key_files |
| 316 | |
| 317 | def process_codebase(self, codebase, tallies_key_files, **kwargs): |
| 318 | tally_codebase_key_files(codebase, **kwargs) |
| 319 | |
| 320 | |
| 321 | def tally_codebase_key_files(codebase, field='tallies', **kwargs): |
nothing calls this directly
no test coverage detected