diff --git a/scripts/lint.php b/scripts/lint.php index b2b0219..afe9566 100644 --- a/scripts/lint.php +++ b/scripts/lint.php @@ -1,19 +1,22 @@ $value) { + if (!in_array($key, SUPPORTED_BL_KEYS, true)) { + fprintf($lint_writer, "Invalid field: " . $key . "\n"); + ++$error_count; + } + } // `id` is a string if (gettype($item['id']) != 'string') { fprintf($lint_writer, "Expected `id` field to be a string, found: " . gettype($item['id']) . "\n"); @@ -188,6 +194,13 @@ function validate_bloatware_item(array $item): int { function validate_suggestion_item(array $item): int { global $lint_writer; $error_count = 0; + // Check if the keys are valid + foreach ($item as $key => $value) { + if (!in_array($key, SUPPORTED_SUG_KEYS, true)) { + fprintf($lint_writer, "Invalid field: " . $key . "\n"); + ++$error_count; + } + } // `id` is a string if (gettype($item['id']) != 'string') { fprintf($lint_writer, "Expected `id` field to be a string, found: " . gettype($item['id']) . "\n");