| Conditions | 3 |
| Total Lines | 9 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | # SPDX-FileCopyrightText: 2020 Peter Bittner <[email protected]> |
||
| 15 | def build_git_clean_command( |
||
| 16 | ignore_patterns: list[str], |
||
| 17 | dry_run=False, |
||
| 18 | force=False, |
||
| 19 | ) -> list[str]: |
||
| 20 | """Build the git clean command with appropriate flags.""" |
||
| 21 | exclude = (item for pattern in ignore_patterns for item in ['-e', pattern]) |
||
| 22 | mode = '-n' if dry_run else '-f' if force else '-i' |
||
| 23 | return ['git', 'clean', '-dx', *exclude, mode] |
||
| 24 | |||
| 43 |