格式化文件大小
(self, size_bytes: int)
| 830 | } |
| 831 | |
| 832 | def format_size(self, size_bytes: int) -> str: |
| 833 | """格式化文件大小""" |
| 834 | for unit in ['B', 'KB', 'MB', 'GB', 'TB']: |
| 835 | if size_bytes < 1024.0: |
| 836 | return f"{size_bytes:.2f} {unit}" |
| 837 | size_bytes /= 1024.0 |
| 838 | return f"{size_bytes:.2f} PB" |
| 839 | |
| 840 | def should_skip_file(self, filepath: str, rule: Dict) -> bool: |
| 841 | """判断文件是否应该跳过""" |
no outgoing calls
no test coverage detected