mirror of
https://github.com/apple/pkl.git
synced 2026-03-27 03:21:13 +01:00
Add flag to turn power assertions on/off (#1419)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||
* Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -152,6 +152,9 @@ data class CliBaseOptions(
|
||||
|
||||
/** Defines options for the formatting of calls to the trace() method. */
|
||||
val traceMode: TraceMode? = null,
|
||||
|
||||
/** Whether power assertions are enabled. */
|
||||
val powerAssertionsEnabled: Boolean = false,
|
||||
) {
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||
* Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -102,6 +102,7 @@ abstract class CliCommand(protected val cliOptions: CliBaseOptions) {
|
||||
cliOptions.timeout,
|
||||
stackFrameTransformer,
|
||||
envVars,
|
||||
cliOptions.powerAssertionsEnabled,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -308,5 +309,6 @@ abstract class CliCommand(protected val cliOptions: CliBaseOptions) {
|
||||
.setTimeout(cliOptions.timeout)
|
||||
.setModuleCacheDir(moduleCacheDir)
|
||||
.setTraceMode(traceMode)
|
||||
.setPowerAssertionsEnabled(cliOptions.powerAssertionsEnabled)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||
* Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -316,6 +316,7 @@ class BaseOptions : OptionGroup() {
|
||||
modules: List<URI>,
|
||||
projectOptions: ProjectOptions? = null,
|
||||
testMode: Boolean = false,
|
||||
powerAssertionsEnabled: Boolean = false,
|
||||
): CliBaseOptions {
|
||||
return CliBaseOptions(
|
||||
sourceModules = modules,
|
||||
@@ -343,6 +344,7 @@ class BaseOptions : OptionGroup() {
|
||||
externalModuleReaders = externalModuleReaders,
|
||||
externalResourceReaders = externalResourceReaders,
|
||||
traceMode = traceMode,
|
||||
powerAssertionsEnabled = powerAssertionsEnabled,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user