Clarify code a bit.
This commit is contained in:
+4
-1
@@ -27,7 +27,11 @@ export function readConfig(): ConfigurationOptions {
|
|||||||
const externalConfig = getOptionalInput('config-file')
|
const externalConfig = getOptionalInput('config-file')
|
||||||
if (externalConfig !== undefined) {
|
if (externalConfig !== undefined) {
|
||||||
const config = readConfigFile(externalConfig)
|
const config = readConfigFile(externalConfig)
|
||||||
|
// the reasoning behind reading the inline config when an external
|
||||||
|
// config file is provided is that we still want to allow users to
|
||||||
|
// pass inline options in the presence of an external config file.
|
||||||
const inlineConfig = readInlineConfig()
|
const inlineConfig = readInlineConfig()
|
||||||
|
// the external config takes precedence
|
||||||
return Object.assign({}, inlineConfig, config)
|
return Object.assign({}, inlineConfig, config)
|
||||||
} else {
|
} else {
|
||||||
return readInlineConfig()
|
return readInlineConfig()
|
||||||
@@ -38,7 +42,6 @@ export function readInlineConfig(): ConfigurationOptions {
|
|||||||
const fail_on_severity = SeveritySchema.parse(
|
const fail_on_severity = SeveritySchema.parse(
|
||||||
getOptionalInput('fail-on-severity')
|
getOptionalInput('fail-on-severity')
|
||||||
)
|
)
|
||||||
|
|
||||||
const fail_on_scopes = z
|
const fail_on_scopes = z
|
||||||
.array(z.enum(SCOPES))
|
.array(z.enum(SCOPES))
|
||||||
.default(['runtime'])
|
.default(['runtime'])
|
||||||
|
|||||||
Reference in New Issue
Block a user