standardlint
Version:
Extensible standards linter and auditor.
33 lines (30 loc) • 803 B
JavaScript
import {
getJSONFileContents
} from "./chunk-K3CM3JAW.mjs";
import {
logDefaultPathMessage
} from "./chunk-322CAOWI.mjs";
import {
calculatePass
} from "./chunk-I4KWICZI.mjs";
// src/checks/checkForDefinedServiceLevelObjectives.ts
function checkForDefinedServiceLevelObjectives(severity, basePath, customPath) {
const path = customPath || "manifest.json";
const name = "SLOs";
const message = "Check for defined Service Level Objectives";
if (!customPath) logDefaultPathMessage(name, path);
const serviceMetadata = getJSONFileContents(
basePath,
path
);
const result = serviceMetadata?.slo && serviceMetadata?.slo.length > 0;
return {
name,
status: calculatePass(result, severity),
message,
path
};
}
export {
checkForDefinedServiceLevelObjectives
};