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

SystemRDL / PeakRDL / 4497728222

pending completion
4497728222

push

github

Alex Mykyta
Add link to community plugins

207 of 214 branches covered (96.73%)

Branch coverage included in aggregate %.

545 of 549 relevant lines covered (99.27%)

5.89 hits per line

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

100.0
/src/peakrdl/cmd/preprocess.py
1
from typing import TYPE_CHECKING, List
6✔
2

3
from systemrdl import RDLCompiler
6✔
4

5
from ..subcommand import Subcommand
6✔
6

7
if TYPE_CHECKING:
8
    import argparse
9
    from ..plugins.importer import ImporterPlugin
10

11
class Preprocess(Subcommand):
6✔
12
    name = "preprocess"
6✔
13
    short_desc = "Preprocess SystemRDL and write the result to a file"
6✔
14

15
    def add_arguments(self, parser: 'argparse._ActionsContainer', importers: 'List[ImporterPlugin]') -> None:
6✔
16
        grp = parser.add_argument_group("preprocessor args")
6✔
17
        grp.add_argument(
6✔
18
            "file",
19
            help="SystemRDL file to preprocess"
20
        )
21
        grp.add_argument(
6✔
22
            "-I",
23
            dest="incdirs",
24
            metavar="INCDIR",
25
            action="append",
26
            help='Search directory for files included with `include "filename"',
27
        )
28
        grp.add_argument(
6✔
29
            "-o",
30
            dest="output",
31
            required=True,
32
            help="Output path",
33
        )
34

35
    def main(self, importers: 'List[ImporterPlugin]', options: 'argparse.Namespace') -> None:
6✔
36
        rdlc = RDLCompiler()
6✔
37
        f_info = rdlc.preprocess_file(options.file, options.incdirs)
6✔
38
        with open(options.output, 'w', encoding='utf-8') as f:
6✔
39
            f.write(f_info.preprocessed_text)
6✔
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

© 2025 Coveralls, Inc