diff --git a/.github/renovate-tracked-deps.json b/.github/renovate-tracked-deps.json index c2224fdb..33bfc8bb 100644 --- a/.github/renovate-tracked-deps.json +++ b/.github/renovate-tracked-deps.json @@ -19,6 +19,13 @@ "mise" ] }, + "README.md": { + "regex": [ + "koalaman/shellcheck", + "mvdan/sh", + "rhysd/actionlint" + ] + }, "mise.toml": { "mise": [ "actionlint", diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 31eb68f2..74fedba3 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -23,6 +23,36 @@ matchStrings: ["https://raw\\.githubusercontent\\.com/(?[^/]+/[^/]+)/(?[a-f0-9]{40})/.*#\\s*(?v\\S+)"], datasourceTemplate: "github-tags", }, + { + customType: "regex", + description: "Update shellcheck version in README quickstart example", + managerFilePatterns: ["/^README\\.md$/"], + matchStrings: [ + "# Add whichever linters apply to your repo:\\n[\\s\\S]*?\"github:koalaman/shellcheck\"\\s*=\\s*\"(?[^\"]+)\"[\\s\\S]*?\\n```", + ], + datasourceTemplate: "github-releases", + depNameTemplate: "koalaman/shellcheck", + }, + { + customType: "regex", + description: "Update shfmt version in README quickstart example", + managerFilePatterns: ["/^README\\.md$/"], + matchStrings: [ + "# Add whichever linters apply to your repo:\\n[\\s\\S]*?shfmt\\s*=\\s*\"(?[^\"]+)\"[\\s\\S]*?\\n```", + ], + datasourceTemplate: "github-releases", + depNameTemplate: "mvdan/sh", + }, + { + customType: "regex", + description: "Update actionlint version in README quickstart example", + managerFilePatterns: ["/^README\\.md$/"], + matchStrings: [ + "# Add whichever linters apply to your repo:\\n[\\s\\S]*?actionlint\\s*=\\s*\"(?[^\"]+)\"[\\s\\S]*?\\n```", + ], + datasourceTemplate: "github-releases", + depNameTemplate: "rhysd/actionlint", + }, { customType: "regex", description: "Update mise version in GitHub Actions workflows", @@ -82,8 +112,10 @@ "taplo", ], groupName: "linters", + commitMessageTopic: "flint-managed linter updates", description: "Only update flint-managed linters once a week", schedule: ["before 4am on Monday"], + separateMajorMinor: false, }, { matchPackageNames: ["jdx/mise"], diff --git a/README.md b/README.md index 6bcaa818..da3a829f 100644 --- a/README.md +++ b/README.md @@ -74,15 +74,6 @@ Add the linting tools your project needs alongside the `flint` binary itself: "github:koalaman/shellcheck" = "0.11.0" shfmt = "v3.13.1" actionlint = "1.7.10" -rumdl = "0.1.78" -ruff = "0.15.12" -"aqua:owenlamont/ryl" = "0.6.0" -taplo = "0.10.0" -biome = "2.4.12" -rust = "1.95.0" # activates cargo-fmt + cargo-clippy -go = "1.26.2" # activates gofmt -lychee = "0.22.0" # activates links check -"npm:renovate" = "43.141.6" # activates renovate-deps check ``` Then wire up lint tasks: diff --git a/default.json b/default.json index 8807cb69..ea36e9dc 100644 --- a/default.json +++ b/default.json @@ -56,8 +56,10 @@ "taplo" ], "groupName": "linters", + "commitMessageTopic": "flint-managed linter updates", "description": "Only update flint-managed linters once a week", - "schedule": ["before 4am on Monday"] + "schedule": ["before 4am on Monday"], + "separateMajorMinor": false }, { "matchPackageNames": ["jdx/mise"], diff --git a/src/bin/sync-readme-snippets.rs b/src/bin/sync-readme-snippets.rs index 1e98936b..7209f937 100644 --- a/src/bin/sync-readme-snippets.rs +++ b/src/bin/sync-readme-snippets.rs @@ -75,28 +75,11 @@ fn render_quickstart_tools(table: &toml::Table) -> Result { \"github:koalaman/shellcheck\" = \"{shellcheck}\"\n\ shfmt = \"{shfmt}\"\n\ actionlint = \"{actionlint}\"\n\ -rumdl = \"{rumdl}\"\n\ -ruff = \"{ruff}\"\n\ -\"aqua:owenlamont/ryl\" = \"{ryl}\"\n\ -taplo = \"{taplo}\"\n\ -biome = \"{biome}\"\n\ -rust = \"{rust}\" # activates cargo-fmt + cargo-clippy\n\ -go = \"{go}\" # activates gofmt\n\ -lychee = \"{lychee}\" # activates links check\n\ -\"npm:renovate\" = \"{renovate}\" # activates renovate-deps check", +", flint = env!("CARGO_PKG_VERSION"), shellcheck = versions["github:koalaman/shellcheck"], shfmt = versions["shfmt"], actionlint = versions["actionlint"], - rumdl = versions["rumdl"], - ruff = versions["ruff"], - ryl = versions["aqua:owenlamont/ryl"], - taplo = versions["taplo"], - biome = versions["biome"], - rust = versions["rust"], - go = versions["go"], - lychee = versions["lychee"], - renovate = versions["npm:renovate"], )) } diff --git a/src/readme_snippets.rs b/src/readme_snippets.rs index 175ca4f9..4f965acc 100644 --- a/src/readme_snippets.rs +++ b/src/readme_snippets.rs @@ -1,17 +1,4 @@ pub const INSTALL_MARKER: &str = "Add `flint` to your repo's `mise.toml`:"; pub const QUICKSTART_MARKER: &str = "Add the linting tools your project needs alongside the `flint` binary itself:"; -pub const QUICKSTART_KEYS: &[&str] = &[ - "github:koalaman/shellcheck", - "shfmt", - "actionlint", - "rumdl", - "ruff", - "aqua:owenlamont/ryl", - "taplo", - "biome", - "rust", - "go", - "lychee", - "npm:renovate", -]; +pub const QUICKSTART_KEYS: &[&str] = &["github:koalaman/shellcheck", "shfmt", "actionlint"]; diff --git a/src/registry/tests.rs b/src/registry/tests.rs index 9d976965..b5b3c8d5 100644 --- a/src/registry/tests.rs +++ b/src/registry/tests.rs @@ -424,6 +424,16 @@ fn default_renovate_preset_covers_all_linter_tools_weekly() { )]), "linters package rule must remain on the weekly Monday schedule" ); + assert_eq!( + linters_rule["commitMessageTopic"].as_str(), + Some("flint-managed linter updates"), + "linters package rule must keep the grouped PR title readable" + ); + assert_eq!( + linters_rule["separateMajorMinor"].as_bool(), + Some(false), + "linters package rule must keep major and non-major updates in one Monday PR" + ); assert!( !actual.contains(&"node"), "node is a runtime prerequisite, not a linter, and must not be in the weekly linters rule" @@ -460,6 +470,14 @@ fn repo_renovate_config_stays_aligned_with_shared_preset_contract() { default_rule["schedule"], repo_rule["schedule"], "package rule {group_name:?} schedule in .github/renovate.json5 drifted from default.json" ); + assert_eq!( + default_rule["commitMessageTopic"], repo_rule["commitMessageTopic"], + "package rule {group_name:?} commitMessageTopic in .github/renovate.json5 drifted from default.json" + ); + assert_eq!( + default_rule["separateMajorMinor"], repo_rule["separateMajorMinor"], + "package rule {group_name:?} separateMajorMinor in .github/renovate.json5 drifted from default.json" + ); assert_eq!( package_names(default_rule), package_names(repo_rule), @@ -472,15 +490,19 @@ fn repo_renovate_config_stays_aligned_with_shared_preset_contract() { ); } - let description = "Update mise version in GitHub Actions workflows"; - let default_manager = custom_manager_by_description(&default_parsed, description) - .unwrap_or_else(|| panic!("default.json missing custom manager {description:?}")); - let repo_manager = custom_manager_by_description(&repo_parsed, description) - .unwrap_or_else(|| panic!(".github/renovate.json5 missing custom manager {description:?}")); - assert_eq!( - default_manager, repo_manager, - "custom manager {description:?} in .github/renovate.json5 drifted from default.json" - ); + { + let description = "Update mise version in GitHub Actions workflows"; + let default_manager = custom_manager_by_description(&default_parsed, description) + .unwrap_or_else(|| panic!("default.json missing custom manager {description:?}")); + let repo_manager = + custom_manager_by_description(&repo_parsed, description).unwrap_or_else(|| { + panic!(".github/renovate.json5 missing custom manager {description:?}") + }); + assert_eq!( + default_manager, repo_manager, + "custom manager {description:?} in .github/renovate.json5 drifted from default.json" + ); + } } #[test] @@ -645,7 +667,6 @@ fn readme_quickstart_tools_snippets_stay_current() { env!("CARGO_PKG_VERSION").to_string(), ))) .collect::>(); - let actual = toml_tool_versions_from_table( quickstart_tools, &[ @@ -653,15 +674,6 @@ fn readme_quickstart_tools_snippets_stay_current() { "github:koalaman/shellcheck", "shfmt", "actionlint", - "rumdl", - "ruff", - "aqua:owenlamont/ryl", - "taplo", - "biome", - "rust", - "go", - "lychee", - "npm:renovate", ], );