feat: add report.no_time config option for automatic modes
Add YAML section `report.no_time` that controls `--no-time` behavior in automatic modes (`--commit`, `--send`). CLI flag `--no-time` always wins. Manual `--output` ignores the YAML setting. - Config.get_report_no_time() reads the YAML value (defaults to false) - cli._resolve_no_time() encapsulates CLI > YAML priority - --init-config now generates the report section - docs updated in README.md and docs/CONFIG.md Closes #49
This commit is contained in:
@@ -43,6 +43,9 @@ output:
|
||||
filename: "{author}_{from}_{to}.{ext}"
|
||||
default_format: xlsx
|
||||
|
||||
report:
|
||||
no_time: false
|
||||
|
||||
email:
|
||||
smtp:
|
||||
host: smtp.example.com
|
||||
@@ -273,6 +276,36 @@ email:
|
||||
**не запрещены** — если вписать `api_key: "abc123"` напрямую, система примет.
|
||||
Права `0600` — основная защита.
|
||||
|
||||
### `report` — настройки содержимого отчёта
|
||||
|
||||
Секция управляет тем, что попадает в сгенерированный отчёт.
|
||||
|
||||
| Поле | Тип | По умолчанию | Описание |
|
||||
|---|---|---|---|
|
||||
| `no_time` | bool | `false` | Не включать затраченное время в файл отчёта |
|
||||
|
||||
`report.no_time` применяется только в автоматических режимах (`--commit`, `--send`).
|
||||
При ручном `--output` YAML-настройка игнорируется — там работает только CLI-флаг `--no-time`.
|
||||
CLI-флаг `--no-time` всегда имеет приоритет над YAML.
|
||||
|
||||
**Примеры:**
|
||||
|
||||
```yaml
|
||||
report:
|
||||
no_time: true
|
||||
```
|
||||
|
||||
```bash
|
||||
# Автоматический режим: время не выводится
|
||||
redmine-reporter --commit
|
||||
|
||||
# Ручной режим: report.no_time игнорируется, время выводится
|
||||
redmine-reporter --output report.odt
|
||||
|
||||
# Ручной режим с явным флагом: время не выводится
|
||||
redmine-reporter --output report.odt --no-time
|
||||
```
|
||||
|
||||
## Разрешение выходного пути
|
||||
|
||||
Функция `resolve_output_path()` определяет итоговый путь к файлу:
|
||||
|
||||
Reference in New Issue
Block a user