Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 24 additions & 5 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
},
{
Expand Down
25 changes: 22 additions & 3 deletions default.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
56 changes: 55 additions & 1 deletion src/registry/tests.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::collections::HashMap;
use std::collections::{BTreeSet, HashMap};
use std::path::Path;

use super::*;
Expand Down Expand Up @@ -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
Expand Down
Loading