• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mbits-os / quick_dra / 22038263728

15 Feb 2026 03:31PM UTC coverage: 93.378% (+6.4%) from 87.008%
22038263728

Pull #39

github

web-flow
Merge 74a89bbd4 into 7d773e4d9
Pull Request #39: testing

58 of 67 new or added lines in 23 files covered. (86.57%)

75 existing lines in 12 files now uncovered.

4033 of 4319 relevant lines covered (93.38%)

1107.01 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

91.84
/libs/cli/src/xml/xml_command.cpp
1
// Copyright (c) 2026 midnightBITS
2
// This code is licensed under MIT license (see LICENSE for details)
3

4
#include <fmt/format.h>
5
#include <args_parser.hpp>
6
#include <chrono>
7
#include <filesystem>
8
#include <fstream>
9
#include <quick_dra/base/paths.hpp>
10
#include <quick_dra/base/verbose.hpp>
11
#include <quick_dra/docs/file_set.hpp>
12
#include <quick_dra/docs/forms.hpp>
13
#include <quick_dra/docs/summary.hpp>
14
#include <quick_dra/docs/xml.hpp>
15
#include <quick_dra/docs/xml_builder.hpp>
16
#include <quick_dra/models/types.hpp>
17
#include <quick_dra/version.hpp>
18
#include "../commands.hpp"
19
#include "cli_options.hpp"
20

21
using namespace std::literals;
22

23
namespace quick_dra::builtin::xml {
24
        int handle(std::string_view tool_name,
24✔
25
                   args::arglist arguments,
26
                   std::string_view description) {
1✔
27
                auto const opt = options_from_cli({tool_name, arguments}, description);
73✔
28

48✔
29
                if (opt.verbose_level > verbose::none) {
22✔
30
                        fmt::print("-- config used: {}\n", opt.config_path.string());
73✔
31
                }
36✔
32

48✔
33
                if (opt.verbose_level >= verbose::names_and_summary) {
22✔
34
                        fmt::print("-- today: {}-{:02}-{:02}\n",
56✔
35
                                   static_cast<int>(opt.today.year()),
50✔
36
                                   static_cast<unsigned>(opt.today.month()),
50✔
37
                                   static_cast<unsigned>(opt.today.day()));
60✔
38
                }
30✔
39

48✔
40
                fmt::print("-- report: #{} {}-{:02}\n", opt.report_index,
84✔
41
                           static_cast<int>(opt.date.year()),
76✔
42
                           static_cast<unsigned>(opt.date.month()));
76✔
43

48✔
44
                auto cfg = parse_config(opt.verbose_level, opt.date, opt.config_path,
84✔
45
                                        opt.tax_config_path);
76✔
46
                if (!cfg) {
22✔
47
                        return 1;
×
48
                }
49

48✔
50
                auto raw_templates = quick_dra::templates::parse_yaml(
8✔
51
                    platform::config_data_dir() / "templates.yaml"sv);
69✔
52
                if (!raw_templates) {
22✔
NEW
53
                        return 1;
×
54
                }
55

48✔
56
                auto const forms = prepare_form_set(opt.verbose_level, opt.report_index,
22✔
57
                                                    opt.date, opt.today, *cfg);
69✔
58
                auto const file = build_file_set(
56✔
59
                    opt, forms, compiled_templates::compile(*raw_templates));
69✔
60
                store_xml(file, set_filename(opt.report_index, opt.date),
70✔
61
                          opt.indent_xml);
69✔
62

48✔
63
                if (!opt.print_info && opt.verbose_level != verbose::none) {
22✔
UNCOV
64
                        fmt::print("-- use --info to print summary of amounts to pay\n");
×
65
                }
66

48✔
67
                if (opt.print_info) {
22✔
68
                        auto const lines = gather_summary_data(forms);
64✔
69
                        print_summary(lines);
64✔
70
                }
64✔
71

48✔
72
                if (opt.verbose_level >= verbose::last) {
22✔
UNCOV
73
                        fmt::print("-- (no more info to unveil)\n");
×
74
                }
75

48✔
76
                return 0;
70✔
77
        }
70✔
78
}  // namespace quick_dra::builtin::xml
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc