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

me-viper / OpaDotNet / 11512106788

25 Oct 2024 04:51AM CUT coverage: 84.386%. Remained the same
11512106788

push

github

me-viper
ci: Add CI inputs

1820 of 2364 branches covered (76.99%)

Branch coverage included in aggregate %.

3817 of 4316 relevant lines covered (88.44%)

1737.21 hits per line

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

54.17
/src/Compilation.Abstractions/src/CompilationParameters.cs
1
using JetBrains.Annotations;
2

3
namespace OpaDotNet.Compilation.Abstractions;
4

5
/// <summary>
6
/// Compilation parameters.
7
/// </summary>
8
[PublicAPI]
9
public record CompilationParameters
10
{
11
    /// <summary>
12
    /// Specifies if compilation source if file or bundle.
13
    /// </summary>
14
    public bool IsBundle { get; set; }
2,709✔
15

16
    /// <summary>
17
    /// Which documents (entrypoints) will be queried when asking for policy decisions.
18
    /// </summary>
19
    public IReadOnlyList<string>? Entrypoints { get; set; }
2,508✔
20

21
    /// <summary>
22
    /// Capabilities file that defines the built-in functions and other language features that policies may depend on.
23
    /// <see cref="CapabilitiesFilePath"/> overrides any other specified capabilities.
24
    /// </summary>
25
    public string? CapabilitiesFilePath { get; set; }
1,182✔
26

27
    /// <summary>
28
    /// Capabilities json that defines the built-in functions and other language features that policies may depend on.
29
    /// </summary>
30
    [Obsolete("Use CompilationParameters.CapabilitiesBytes instead")]
31
    public Stream? CapabilitiesStream
32
    {
33
        get => CapabilitiesBytes.IsEmpty ? null : new MemoryStream(CapabilitiesBytes.ToArray());
×
34
        init
35
        {
36
            if (value == null)
×
37
                return;
×
38

39
            Memory<byte> buf = new byte[value.Length];
×
40
            _ = value.Read(buf.Span);
×
41
            CapabilitiesBytes = buf;
×
42
        }
×
43
    }
44

45
    /// <summary>
46
    /// Capabilities json that defines the built-in functions and other language features that policies may depend on.
47
    /// </summary>
48
    public ReadOnlyMemory<byte> CapabilitiesBytes { get; set; } = Memory<byte>.Empty;
2,523✔
49

50
    /// <summary>
51
    /// Output bundle revision.
52
    /// </summary>
53
    public string? Revision { get; set; }
1,081✔
54

55
    /// <summary>
56
    /// Path compiler will use to store intermediate compilation artifacts.
57
    /// </summary>
58
    /// <remarks>
59
    /// Directory must exist and requires write permissions.
60
    /// </remarks>
61
    public string? OutputPath { get; set; }
1,268✔
62

63
    /// <summary>
64
    /// OPA capabilities version. If set, compiler will merge capabilities
65
    /// of specified version with any additional custom capabilities.
66
    /// </summary>
67
    public string? CapabilitiesVersion { get; set; }
1,459✔
68

69
    /// <summary>
70
    /// If <c>true</c> compiler will log debug information; otherwise <c>false</c>;
71
    /// </summary>
72
    public bool Debug { get; set; }
1,385✔
73

74
    // BUG. Setting this to value > 0 crashes OPA compiler.
75
    // /// <summary>
76
    // /// Optimization level.
77
    // /// </summary>
78
    // public int OptimizationLevel { get; set; }
79

80
    /// <summary>
81
    /// Exclude dependents of entrypoints.
82
    /// </summary>
83
    public bool PruneUnused { get; set; }
1,347✔
84

85
    /// <summary>
86
    /// Set file and directory names to ignore during loading (e.g., '.*' excludes hidden files).
87
    /// </summary>
88
    public IReadOnlySet<string> Ignore { get; set; } = new HashSet<string>();
2,449✔
89

90
    /// <summary>
91
    /// Sets OPA features and behaviors that will be enabled by default.
92
    /// </summary>
93
    public RegoVersion RegoVersion { get; set; } = RegoVersion.V0;
1,343✔
94

95
    /// <summary>
96
    /// Follow symlinks in the input set of paths when building the bundle.
97
    /// </summary>
98
    public bool FollowSymlinks { get; set; }
1,341✔
99

100
    /// <summary>
101
    /// If print statements are not enabled, calls to <c>print()</c> are erased at compile-time
102
    /// </summary>
103
    public bool DisablePrintStatements { get; set; }
801✔
104
}
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