diff --git a/.github/renovate.json5 b/.github/renovate.json5 index b553f705..03a2a4eb 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -78,14 +78,33 @@ ], packageRules: [ { - matchPackageNames: ["jdx/mise"], - groupName: "mise", - description: "Only update mise once a week", + matchPackageNames: [ + "actionlint", + "cargo:xmloxide", + "editorconfig-checker", + "github:google/google-java-format", + "github:koalaman/shellcheck", + "github:pinterest/ktlint", + "golangci-lint", + "hadolint", + "lychee", + "npm:@biomejs/biome", + "npm:markdownlint-cli2", + "npm:prettier", + "npm:renovate", + "pipx:codespell", + "pipx:ruff", + "shellcheck", + "shfmt", + ], + groupName: "linters", + description: "Only update flint-managed linters once a week", schedule: ["before 4am on Monday"], }, { - matchPackageNames: ["renovate"], - description: "Only update renovate once a week", + matchPackageNames: ["jdx/mise"], + groupName: "mise", + description: "Only update mise once a week", schedule: ["before 4am on Monday"], }, { diff --git a/default.json b/default.json index 40e9e9bf..126c63f5 100644 --- a/default.json +++ b/default.json @@ -36,9 +36,28 @@ ], "packageRules": [ { - "matchPackageNames": ["renovate"], - "description": "Only update renovate once a week", - "schedule": ["before 6am on Monday"] + "matchPackageNames": [ + "actionlint", + "cargo:xmloxide", + "editorconfig-checker", + "github:google/google-java-format", + "github:koalaman/shellcheck", + "github:pinterest/ktlint", + "golangci-lint", + "hadolint", + "lychee", + "npm:@biomejs/biome", + "npm:markdownlint-cli2", + "npm:prettier", + "npm:renovate", + "pipx:codespell", + "pipx:ruff", + "shellcheck", + "shfmt" + ], + "groupName": "linters", + "description": "Only update flint-managed linters once a week", + "schedule": ["before 4am on Monday"] }, { "matchPackageNames": ["jdx/mise"], diff --git a/src/registry/tests.rs b/src/registry/tests.rs index a0777a77..b9632100 100644 --- a/src/registry/tests.rs +++ b/src/registry/tests.rs @@ -1,4 +1,4 @@ -use std::collections::HashMap; +use std::collections::{BTreeSet, HashMap}; use std::path::Path; use super::*; @@ -143,6 +143,60 @@ fn all_registry_binaries_found() { ); } +#[test] +fn default_renovate_preset_covers_all_linter_tools_weekly() { + let manifest_dir = Path::new(env!("CARGO_MANIFEST_DIR")); + let default_json_path = manifest_dir.join("default.json"); + let default_json = + std::fs::read_to_string(&default_json_path).expect("default.json must be readable"); + let parsed: serde_json::Value = + serde_json::from_str(&default_json).expect("default.json must be valid JSON"); + + let package_rules = parsed["packageRules"] + .as_array() + .expect("default.json packageRules must be an array"); + let linters_rule = package_rules + .iter() + .find(|rule| rule["groupName"].as_str() == Some("linters")) + .expect("default.json must define a packageRules entry with groupName 'linters'"); + + let actual: BTreeSet<&str> = linters_rule["matchPackageNames"] + .as_array() + .expect("linters package rule must declare matchPackageNames") + .iter() + .map(|value| { + value + .as_str() + .expect("linters package names must be strings") + }) + .collect(); + + let mut expected: BTreeSet<&str> = builtin() + .into_iter() + .filter(|check| check.uses_binary()) + .filter(|check| !check.is_toolchain()) + .filter_map(|check| check.mise_tool_name.or(Some(check.bin_name))) + .collect(); + // Backward-compatible alias still used in this repo's own mise.toml. + expected.insert("github:koalaman/shellcheck"); + + assert_eq!( + linters_rule["schedule"].as_array(), + Some(&vec![serde_json::Value::String( + "before 4am on Monday".to_string() + )]), + "linters package rule must remain on the weekly Monday schedule" + ); + assert!( + !actual.contains("node"), + "node is a runtime prerequisite, not a linter, and must not be in the weekly linters rule" + ); + assert_eq!( + actual, expected, + "default.json weekly linters rule is out of sync with the linter registry" + ); +} + /// Verifies README summary table and docs/linters.md detail sections stay /// in sync with the registry. The summary table lives in README.md between /// `registry-table-*` markers; the per-linter detail sections live in