diff --git a/.github/renovate-tracked-deps.json b/.github/renovate-tracked-deps.json index 984f3e3e..d4aa9f45 100644 --- a/.github/renovate-tracked-deps.json +++ b/.github/renovate-tracked-deps.json @@ -4,6 +4,10 @@ "packageName": "rhysd/actionlint", "datasource": "github-releases" }, + "aqua:jonwiggins/xmloxide": { + "packageName": "jonwiggins/xmloxide", + "datasource": "github-tags" + }, "aqua:owenlamont/ryl": { "packageName": "owenlamont/ryl", "datasource": "github-tags" @@ -15,22 +19,14 @@ "packageName": "editorconfig-checker/editorconfig-checker", "datasource": "github-releases" }, - "github:google/google-java-format": { - "packageName": "google/google-java-format", - "datasource": "github-releases" - }, - "github:jonwiggins/xmloxide": { - "packageName": "jonwiggins/xmloxide", - "datasource": "github-releases" - }, - "github:koalaman/shellcheck": { - "packageName": "koalaman/shellcheck", - "datasource": "github-releases" - }, "golangci-lint": { "packageName": "golangci/golangci-lint", "datasource": "github-tags" }, + "google-java-format": { + "packageName": "google-java-format", + "datasource": "github-releases" + }, "hadolint": { "packageName": "hadolint/hadolint", "datasource": "github-tags" @@ -63,6 +59,10 @@ "packageName": "rvben/rumdl", "datasource": "github-releases" }, + "shellcheck": { + "packageName": "koalaman/shellcheck", + "datasource": "github-releases" + }, "shfmt": { "packageName": "mvdan/sh", "datasource": "github-releases" @@ -96,22 +96,21 @@ "README.md": { "regex": [ "actionlint", - "github:koalaman/shellcheck", + "shellcheck", "shfmt" ] }, "mise.toml": { "mise": [ "actionlint", + "aqua:jonwiggins/xmloxide", "aqua:owenlamont/ryl", "biome", "dotnet", "editorconfig-checker", - "github:google/google-java-format", - "github:jonwiggins/xmloxide", - "github:koalaman/shellcheck", "go", "golangci-lint", + "google-java-format", "hadolint", "ktlint", "lychee", @@ -122,6 +121,7 @@ "ruff", "rumdl", "rust", + "shellcheck", "shfmt", "taplo" ] diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 5fa19c28..6be3cb3a 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -28,10 +28,10 @@ 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```", + "# Add whichever linters apply to your repo:\\n[\\s\\S]*?shellcheck\\s*=\\s*\"(?[^\"]+)\"[\\s\\S]*?\\n```", ], datasourceTemplate: "github-releases", - depNameTemplate: "github:koalaman/shellcheck", + depNameTemplate: "shellcheck", packageNameTemplate: "koalaman/shellcheck", }, { @@ -97,13 +97,12 @@ { matchDepNames: [ "actionlint", + "aqua:jonwiggins/xmloxide", "aqua:owenlamont/ryl", "biome", "editorconfig-checker", - "github:google/google-java-format", - "github:jonwiggins/xmloxide", - "github:koalaman/shellcheck", "golangci-lint", + "google-java-format", "hadolint", "ktlint", "lychee", @@ -111,6 +110,7 @@ "pipx:codespell", "ruff", "rumdl", + "shellcheck", "shfmt", "taplo", ], diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 55ee24bf..bef7c015 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -25,8 +25,8 @@ jobs: - name: Setup mise uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4.0.1 with: - version: v2026.4.28 - sha256: 9655492db554e8f70a69830f54307ac0f4681d6c42f9844e862528b7853d09d1 + version: v2026.5.0 + sha256: 7db5db7a36d28203eb8329140d98fb26b41f5efea32d762f69a1e4b369e1e1a8 # mise may activate an existing Rust toolchain without adding missing components. - name: Install Rust lint components diff --git a/.github/workflows/release-assets.yml b/.github/workflows/release-assets.yml index 0bc737fb..943c76c7 100644 --- a/.github/workflows/release-assets.yml +++ b/.github/workflows/release-assets.yml @@ -30,25 +30,25 @@ jobs: include: - target: x86_64-unknown-linux-gnu runner: ubuntu-24.04 - mise_version: v2026.4.28 - mise_sha256: 9655492db554e8f70a69830f54307ac0f4681d6c42f9844e862528b7853d09d1 + mise_version: v2026.5.0 + mise_sha256: 7db5db7a36d28203eb8329140d98fb26b41f5efea32d762f69a1e4b369e1e1a8 - target: aarch64-unknown-linux-gnu runner: ubuntu-24.04 build-tool: cross - mise_version: v2026.4.28 - mise_sha256: 9655492db554e8f70a69830f54307ac0f4681d6c42f9844e862528b7853d09d1 + mise_version: v2026.5.0 + mise_sha256: 7db5db7a36d28203eb8329140d98fb26b41f5efea32d762f69a1e4b369e1e1a8 - target: x86_64-apple-darwin runner: macos-15-intel - mise_version: v2026.4.28 - mise_sha256: 43c02a612949a37ba53bb4e1e89859da2b198b6e7dad753f31cf66db5af36b19 + mise_version: v2026.5.0 + mise_sha256: cbceffc0d01369f75aaca2eedbc6c2e2852534b82eed10e212323d4b4e533561 - target: aarch64-apple-darwin runner: macos-latest - mise_version: v2026.4.28 - mise_sha256: f0f5fa48643a00442c8cc066f8350285896561f2491bcbbee93b1a9a8249816d + mise_version: v2026.5.0 + mise_sha256: e0267e58c51c88ab8c0f88454f13513ce625df015fcbd4e264a0b23185dc5a7f - target: x86_64-pc-windows-msvc runner: windows-latest - mise_version: v2026.4.28 - mise_sha256: 663cc40a25e8c0ad003ad26b0b3a8c33171d2e70ca4c25a7be017fe988acd95a + mise_version: v2026.5.0 + mise_sha256: 106ce5cc7519eeda042373f84734ac0be20c5b6aa23f57d16da4a9e36243ee85 steps: - name: Checkout code diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml index a1c6e695..48dad072 100644 --- a/.github/workflows/release-plz.yml +++ b/.github/workflows/release-plz.yml @@ -27,8 +27,8 @@ jobs: - name: Setup mise uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4.0.1 with: - version: v2026.4.28 - sha256: 9655492db554e8f70a69830f54307ac0f4681d6c42f9844e862528b7853d09d1 + version: v2026.5.0 + sha256: 7db5db7a36d28203eb8329140d98fb26b41f5efea32d762f69a1e4b369e1e1a8 - name: Create release metadata env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -57,8 +57,8 @@ jobs: - name: Setup mise uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4.0.1 with: - version: v2026.4.28 - sha256: 9655492db554e8f70a69830f54307ac0f4681d6c42f9844e862528b7853d09d1 + version: v2026.5.0 + sha256: 7db5db7a36d28203eb8329140d98fb26b41f5efea32d762f69a1e4b369e1e1a8 - name: Update release PR run: mise run release:pr env: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 10dc6cc4..1c24875f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,14 +17,14 @@ jobs: matrix: include: - os: ubuntu-24.04 - mise_version: v2026.4.28 - mise_sha256: 9655492db554e8f70a69830f54307ac0f4681d6c42f9844e862528b7853d09d1 + mise_version: v2026.5.0 + mise_sha256: 7db5db7a36d28203eb8329140d98fb26b41f5efea32d762f69a1e4b369e1e1a8 - os: macos-15 - mise_version: v2026.4.28 - mise_sha256: f0f5fa48643a00442c8cc066f8350285896561f2491bcbbee93b1a9a8249816d + mise_version: v2026.5.0 + mise_sha256: e0267e58c51c88ab8c0f88454f13513ce625df015fcbd4e264a0b23185dc5a7f - os: windows-2025 - mise_version: v2026.4.28 - mise_sha256: 663cc40a25e8c0ad003ad26b0b3a8c33171d2e70ca4c25a7be017fe988acd95a + mise_version: v2026.5.0 + mise_sha256: 106ce5cc7519eeda042373f84734ac0be20c5b6aa23f57d16da4a9e36243ee85 permissions: contents: read diff --git a/README.md b/README.md index da3a829f..c96d6c0b 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Add `flint` to your repo's `mise.toml`: ```toml [tools] -"github:grafana/flint" = "0.21.0" +"aqua:grafana/flint" = "0.21.0" ``` Bootstrap a repo with `flint init` (scaffolds config). Install a @@ -68,10 +68,10 @@ Add the linting tools your project needs alongside the `flint` binary itself: ```toml [tools] -"github:grafana/flint" = "0.21.0" +"aqua:grafana/flint" = "0.21.0" # Add whichever linters apply to your repo: -"github:koalaman/shellcheck" = "0.11.0" +shellcheck = "0.11.0" shfmt = "v3.13.1" actionlint = "1.7.10" ``` diff --git a/default.json b/default.json index 448b4523..b8c365ec 100644 --- a/default.json +++ b/default.json @@ -38,13 +38,12 @@ { "matchDepNames": [ "actionlint", + "aqua:jonwiggins/xmloxide", "aqua:owenlamont/ryl", "biome", "editorconfig-checker", - "github:google/google-java-format", - "github:jonwiggins/xmloxide", - "github:koalaman/shellcheck", "golangci-lint", + "google-java-format", "hadolint", "ktlint", "lychee", @@ -52,6 +51,7 @@ "pipx:codespell", "ruff", "rumdl", + "shellcheck", "shfmt", "taplo" ], diff --git a/docs/alternatives.md b/docs/alternatives.md index 859e5b13..fdaf579e 100644 --- a/docs/alternatives.md +++ b/docs/alternatives.md @@ -99,7 +99,7 @@ instead of being entangled with compile or test phases, so repos can reason about ownership and failures more cleanly. To migrate: remove `spotless-maven-plugin` from `pom.xml` (and any -`spotless.skip` properties), add `"github:google/google-java-format"` to +`spotless.skip` properties), add `"google-java-format"` to `[tools]` in `mise.toml`, and run `flint run --fix` once to confirm the repo is clean. diff --git a/docs/cli.md b/docs/cli.md index 0cb23c3c..f1be8057 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -50,7 +50,7 @@ A check runs against all matching files when: - the check is newly active because its tool was added to `mise.toml` - the check's tool version changed in `mise.toml` - the pinned Flint tool changed in `mise.toml`, either released - `github:grafana/flint` or a cargo-backed prerelease revision, which expands + `aqua:grafana/flint` or a cargo-backed prerelease revision, which expands all active checks - the check's flint-managed config file changed, such as `.shellcheckrc` or `.yamllint.yml` in `FLINT_CONFIG_DIR` diff --git a/mise.toml b/mise.toml index 71b28ac4..1a07fb01 100644 --- a/mise.toml +++ b/mise.toml @@ -10,13 +10,12 @@ rust = { version = "1.95.0", components = "clippy,rustfmt" } # Linters actionlint = "1.7.10" +"aqua:jonwiggins/xmloxide" = "v0.4.2" "aqua:owenlamont/ryl" = "0.8.0" biome = "2.4.12" editorconfig-checker = "v3.6.1" -"github:google/google-java-format" = "1.35.0" -"github:jonwiggins/xmloxide" = "v0.4.2" -"github:koalaman/shellcheck" = "0.11.0" golangci-lint = "2.12.1" +google-java-format = "1.35.0" hadolint = "2.14.0" ktlint = "1.8.0" lychee = "0.22.0" @@ -24,6 +23,7 @@ lychee = "0.22.0" "pipx:codespell" = "2.4.2" ruff = "0.15.12" rumdl = "0.1.78" +shellcheck = "0.11.0" shfmt = "v3.13.1" taplo = "0.10.0" diff --git a/src/bin/sync-readme-snippets.rs b/src/bin/sync-readme-snippets.rs index 7209f937..013ac11a 100644 --- a/src/bin/sync-readme-snippets.rs +++ b/src/bin/sync-readme-snippets.rs @@ -21,7 +21,7 @@ fn main() -> Result<()> { .context("mise.toml must contain [tools]")?; let install_block = format!( - "[tools]\n\"github:grafana/flint\" = \"{}\"", + "[tools]\n\"aqua:grafana/flint\" = \"{}\"", env!("CARGO_PKG_VERSION") ); replace_fenced_block( @@ -69,15 +69,15 @@ fn render_quickstart_tools(table: &toml::Table) -> Result { let versions = tool_versions(table, readme_snippets::QUICKSTART_KEYS)?; Ok(format!( "[tools]\n\ -\"github:grafana/flint\" = \"{flint}\"\n\ +\"aqua:grafana/flint\" = \"{flint}\"\n\ \n\ # Add whichever linters apply to your repo:\n\ -\"github:koalaman/shellcheck\" = \"{shellcheck}\"\n\ +shellcheck = \"{shellcheck}\"\n\ shfmt = \"{shfmt}\"\n\ actionlint = \"{actionlint}\"\n\ ", flint = env!("CARGO_PKG_VERSION"), - shellcheck = versions["github:koalaman/shellcheck"], + shellcheck = versions["shellcheck"], shfmt = versions["shfmt"], actionlint = versions["actionlint"], )) diff --git a/src/init/mise_tools.rs b/src/init/mise_tools.rs index 6731a808..09091ad1 100644 --- a/src/init/mise_tools.rs +++ b/src/init/mise_tools.rs @@ -73,7 +73,7 @@ fn ensure_node_for_npm_with( Ok(true) } -/// Pins `github:grafana/flint` in mise.toml at the calling binary's version so +/// Pins `aqua:grafana/flint` in mise.toml at the calling binary's version so /// contributors all run the same flint release. Skips when the key already /// exists (any pin — never overwrite the user's explicit choice). Pre-release /// suffixes are stripped to match the Renovate preset tag format. @@ -88,7 +88,7 @@ fn ensure_flint_self_pin_with( flint_rev: Option<&str>, runner: impl FnMut(&Path, &str, &str), ) -> Result { - const RELEASE_KEY: &str = "github:grafana/flint"; + const RELEASE_KEY: &str = "aqua:grafana/flint"; const CARGO_KEY: &str = "cargo:https://github.com/grafana/flint"; let mise_path = project_root.join("mise.toml"); let content = std::fs::read_to_string(&mise_path).unwrap_or_default(); @@ -173,7 +173,8 @@ fn should_remove_existing_flint_pin( } fn is_flint_tool_key(key: &str) -> bool { - key == "github:grafana/flint" + key == "aqua:grafana/flint" + || key == "github:grafana/flint" || key.starts_with("cargo:https://github.com/grafana/flint") || key.starts_with("cargo:https://github.com/grafana/flint.git") } @@ -486,7 +487,7 @@ mod tests { fn noop_without_npm_tools() { let dir = tempfile::tempdir().unwrap(); let path = dir.path().join("mise.toml"); - let original = "[tools]\n\"github:koalaman/shellcheck\" = \"v0.11.0\"\n"; + let original = "[tools]\nshellcheck = \"v0.11.0\"\n"; std::fs::write(&path, original).unwrap(); let added = ensure_node_for_npm(dir.path()).unwrap(); @@ -549,7 +550,7 @@ mod tests { let result = std::fs::read_to_string(&path).unwrap(); assert!(changed); - assert!(result.contains("\"github:grafana/flint\"")); + assert!(result.contains("\"aqua:grafana/flint\"")); assert!(!result.contains("cargo:https://github.com/grafana/flint")); assert!(result.contains("FLINT_CONFIG_DIR = \".github/config\"")); } @@ -560,7 +561,7 @@ mod tests { let path = dir.path().join("mise.toml"); std::fs::write( &path, - "[tools]\n\"github:grafana/flint\" = \"0.20.5\"\n\n[env]\nFLINT_CONFIG_DIR = \".github/config\"\n", + "[tools]\n\"aqua:grafana/flint\" = \"0.20.5\"\n\n[env]\nFLINT_CONFIG_DIR = \".github/config\"\n", ) .unwrap(); @@ -569,7 +570,7 @@ mod tests { assert!(changed); assert!(result.contains("\"cargo:https://github.com/grafana/flint\" = \"rev:deadbeef\"")); - assert!(!result.contains("\"github:grafana/flint\"")); + assert!(!result.contains("\"aqua:grafana/flint\"")); assert!(result.contains("FLINT_CONFIG_DIR = \".github/config\"")); } @@ -580,12 +581,12 @@ mod tests { std::fs::write(&path, "[tools]\nrust = \"1.95.0\"\n").unwrap(); let changed = ensure_flint_self_pin_with(dir.path(), None, |project_root, key, version| { - assert_eq!(key, "github:grafana/flint"); + assert_eq!(key, "aqua:grafana/flint"); assert_eq!(version, env!("CARGO_PKG_VERSION")); let version = env!("CARGO_PKG_VERSION"); std::fs::write( project_root.join("mise.toml"), - format!("[tools]\nrust = \"1.95.0\"\n\"github:grafana/flint\" = \"{version}\"\n"), + format!("[tools]\nrust = \"1.95.0\"\n\"aqua:grafana/flint\" = \"{version}\"\n"), ) .unwrap(); }) @@ -594,7 +595,7 @@ mod tests { assert!(changed); let result = std::fs::read_to_string(&path).unwrap(); assert!(result.contains(&format!( - "\"github:grafana/flint\" = \"{}\"", + "\"aqua:grafana/flint\" = \"{}\"", env!("CARGO_PKG_VERSION") ))); assert!(!result.contains(&format!("version = \"{}\"", env!("CARGO_PKG_VERSION")))); diff --git a/src/init/scaffold.rs b/src/init/scaffold.rs index dbde5169..2497948e 100644 --- a/src/init/scaffold.rs +++ b/src/init/scaffold.rs @@ -50,8 +50,8 @@ jobs: - name: Setup mise uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4.0.1 with: - version: v2026.4.28 - sha256: 9655492db554e8f70a69830f54307ac0f4681d6c42f9844e862528b7853d09d1 + version: v2026.5.0 + sha256: 7db5db7a36d28203eb8329140d98fb26b41f5efea32d762f69a1e4b369e1e1a8 {rust_steps} - name: Lint env: diff --git a/src/init/tests.rs b/src/init/tests.rs index 2354cc84..1a649fd3 100644 --- a/src/init/tests.rs +++ b/src/init/tests.rs @@ -23,13 +23,13 @@ fn detect_obsolete_keys_finds_known_stale_key() { use detection::detect_obsolete_keys; let mut keys = HashSet::new(); keys.insert("github:mvdan/sh".to_string()); - keys.insert("shellcheck".to_string()); + keys.insert("github:koalaman/shellcheck".to_string()); let found = detect_obsolete_keys(&keys); assert_eq!(found.len(), 2); - assert_eq!(found[0].0, "github:mvdan/sh"); - assert_eq!(found[0].1, "shfmt"); - assert_eq!(found[1].0, "shellcheck"); - assert_eq!(found[1].1, "github:koalaman/shellcheck"); + assert_eq!(found[0].0, "github:koalaman/shellcheck"); + assert_eq!(found[0].1, "shellcheck"); + assert_eq!(found[1].0, "github:mvdan/sh"); + assert_eq!(found[1].1, "shfmt"); } #[test] @@ -37,7 +37,7 @@ fn detect_obsolete_keys_ignores_current_keys() { use detection::detect_obsolete_keys; let mut keys = HashSet::new(); keys.insert("rumdl".to_string()); - keys.insert("github:koalaman/shellcheck".to_string()); + keys.insert("shellcheck".to_string()); let found = detect_obsolete_keys(&keys); assert!(found.is_empty()); } @@ -144,7 +144,7 @@ bats = "1.13.0" java = "temurin-25.0.2+10.0.LTS" node = "24.15.0" "npm:renovate" = "43.0.0" -"github:koalaman/shellcheck" = "0.11.0" +shellcheck = "0.11.0" "#; let tmp = tempfile::NamedTempFile::new().unwrap(); std::fs::write(tmp.path(), content).unwrap(); @@ -173,7 +173,7 @@ fn normalize_tools_section_preserves_unrelated_tool_comments() { node = "24.15.0" # Linters -"github:koalaman/shellcheck" = "0.11.0" +shellcheck = "0.11.0" "#; let tmp = tempfile::NamedTempFile::new().unwrap(); std::fs::write(tmp.path(), content).unwrap(); @@ -193,7 +193,7 @@ custom-tool = "1.0.0" java = "temurin-25.0.3+9.0.LTS" node = "24.15.0" protoc = "34.1" -"github:koalaman/shellcheck" = "0.11.0" +shellcheck = "0.11.0" "#; let tmp = tempfile::NamedTempFile::new().unwrap(); std::fs::write(tmp.path(), content).unwrap(); @@ -205,9 +205,7 @@ protoc = "34.1" let node_pos = result.find("node =").expect("node present"); let protoc_pos = result.find("protoc =").expect("protoc present"); let header_pos = result.find("# Linters").expect("header present"); - let shellcheck_pos = result - .find("\"github:koalaman/shellcheck\" =") - .expect("shellcheck present"); + let shellcheck_pos = result.find("shellcheck =").expect("shellcheck present"); assert!( custom_pos < header_pos && java_pos < header_pos @@ -274,12 +272,12 @@ fn apply_changes_upgrade_preserves_version() { fn parse_tool_keys_reads_simple_toml() { let content = r#" [tools] -"github:koalaman/shellcheck" = "v0.11.0" +shellcheck = "v0.11.0" rumdl = "0.1.0" rust = { version = "1.0", components = "clippy" } "#; let keys = parse_tool_keys(content); - assert!(keys.contains("github:koalaman/shellcheck")); + assert!(keys.contains("shellcheck")); assert!(keys.contains("rumdl")); assert!(keys.contains("rust")); assert!(!keys.contains("nonexistent")); diff --git a/src/main.rs b/src/main.rs index 3953046c..e0971bca 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1147,7 +1147,7 @@ biome = "2.3.14" taplo = "0.10.0" lychee = "0.22.0" "npm:renovate" = "43.92.1" -"github:koalaman/shellcheck" = "v0.11.0" +shellcheck = "v0.11.0" shfmt = "v3.13.1" actionlint = "1.7.10" editorconfig-checker = "v3.6.1" @@ -1220,8 +1220,7 @@ license-header (built-in) not configured fast no Check s .find(|check| check.name == "shellcheck") .expect("shellcheck check"); - let active_without_binary = - mise_tools_from("[tools]\n\"github:koalaman/shellcheck\" = \"v0.11.0\"\n"); + let active_without_binary = mise_tools_from("[tools]\nshellcheck = \"v0.11.0\"\n"); assert_eq!( linter_status(&shellcheck, &active_without_binary, &cfg, |_| false), "no binary" diff --git a/src/readme_snippets.rs b/src/readme_snippets.rs index 4f965acc..e9bc4860 100644 --- a/src/readme_snippets.rs +++ b/src/readme_snippets.rs @@ -1,4 +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"]; +pub const QUICKSTART_KEYS: &[&str] = &["shellcheck", "shfmt", "actionlint"]; diff --git a/src/registry/checks.rs b/src/registry/checks.rs index 56cb4054..ec56dd4d 100644 --- a/src/registry/checks.rs +++ b/src/registry/checks.rs @@ -76,7 +76,7 @@ const RUFF_UNSUPPORTED_CONFIGS: &[ConfigFile] = &[ /// Prefer the user-facing binary or native command name: /// - `shellcheck` → `shellcheck` /// - `aqua:owenlamont/ryl` → `ryl` -/// - `github:jonwiggins/xmloxide` → `xmllint` +/// - `aqua:jonwiggins/xmloxide` → `xmllint` /// /// Exceptions are explicit and should stay rare: /// - clearer package-facing names such as `editorconfig-checker` over `ec` @@ -87,11 +87,10 @@ fn check_shellcheck() -> Check { "shellcheck -x -P SCRIPTDIR {FILE}", &["*.sh", "*.bash", "*.bats"], ) - .mise_tool("github:koalaman/shellcheck") .linter_config(".shellcheckrc", "--rcfile") .baseline_config(ConfigFile::config_dir(".shellcheckrc")) .unsupported_configs(SHELLCHECK_UNSUPPORTED_CONFIGS) - .migrate_tool_keys(&["shellcheck"]) + .migrate_tool_keys(&["github:koalaman/shellcheck"]) .desc("Lint shell scripts for common mistakes") .style() } @@ -192,8 +191,8 @@ fn check_hadolint() -> Check { fn check_xmllint() -> Check { Check::files("xmllint", "xmllint --noout {FILES}", &["*.xml"]) - .mise_tool("github:jonwiggins/xmloxide") - .migrate_tool_keys(&["cargo:xmloxide"]) + .mise_tool("aqua:jonwiggins/xmloxide") + .migrate_tool_keys(&["cargo:xmloxide", "github:jonwiggins/xmloxide"]) .desc("Validate XML files are well-formed") } @@ -344,14 +343,17 @@ fn check_google_java_format() -> Check { &["*.java"], ) .fix("google-java-format -i {FILES}") - .mise_tool("github:google/google-java-format") + .mise_tool("google-java-format") .formatter() .editorconfig_line_length_off( &["*.java"], "Java line length is handled by google-java-format", Some(EditorconfigDirectiveStyle::Slash), ) - .migrate_tool_keys(&["ubi:google/google-java-format"]) + .migrate_tool_keys(&[ + "ubi:google/google-java-format", + "github:google/google-java-format", + ]) .desc("Format Java code") .lang() } diff --git a/src/registry/mise.rs b/src/registry/mise.rs index 3a662892..ea00f78b 100644 --- a/src/registry/mise.rs +++ b/src/registry/mise.rs @@ -7,9 +7,9 @@ use super::types::Check; /// tool name → declared version string. /// /// Also registers normalized aliases for backend-prefixed tools so that checks -/// can match by their bare package/binary name. For example: +/// can match by their bare package key. For example: /// - `"aqua:owenlamont/ryl"` → also registers `"ryl"` -/// - `"github:google/google-java-format"` → also registers `"google-java-format"` +/// - `"aqua:jonwiggins/xmloxide"` → also registers `"xmloxide"` /// /// The original key is always preserved; aliases only fill in missing entries. pub fn read_mise_tools(project_root: &Path) -> HashMap { @@ -118,7 +118,8 @@ fn flint_tool_identity(tools: &HashMap) -> Option { } fn is_flint_tool_key(key: &str) -> bool { - key == "github:grafana/flint" + key == "aqua:grafana/flint" + || key == "github:grafana/flint" || key == "cargo:https://github.com/grafana/flint" || key == "cargo:https://github.com/grafana/flint.git" } diff --git a/src/registry/mod.rs b/src/registry/mod.rs index 3cd10675..55572846 100644 --- a/src/registry/mod.rs +++ b/src/registry/mod.rs @@ -39,6 +39,7 @@ pub fn linter_keys() -> std::collections::HashSet<&'static str> { } keys.extend(obsolete::obsolete_keys().into_iter().map(|(old, _)| old)); keys.extend(obsolete::unsupported_keys().into_iter().map(|(old, _)| old)); + keys.insert("aqua:grafana/flint"); keys.insert("github:grafana/flint"); keys.insert("cargo:https://github.com/grafana/flint"); keys.insert("cargo:https://github.com/grafana/flint.git"); diff --git a/src/registry/obsolete.rs b/src/registry/obsolete.rs index a017fb67..62f7657f 100644 --- a/src/registry/obsolete.rs +++ b/src/registry/obsolete.rs @@ -41,8 +41,5 @@ fn registry_tool_key_migrations() -> Vec<(&'static str, &'static str)> { } fn obsolete_key_present(mise_tools: &HashMap, old: &str) -> bool { - if old == "shellcheck" && mise_tools.contains_key("github:koalaman/shellcheck") { - return false; - } mise_tools.contains_key(old) } diff --git a/src/registry/tests.rs b/src/registry/tests.rs index 641408ae..8755cb93 100644 --- a/src/registry/tests.rs +++ b/src/registry/tests.rs @@ -51,7 +51,7 @@ fn find_obsolete_key_detects_legacy_ruff_backend() { } #[test] -fn shellcheck_alias_does_not_make_github_backend_obsolete() { +fn shellcheck_github_backend_is_obsolete_even_when_bare_key_exists() { let tools = HashMap::from([ ( "github:koalaman/shellcheck".to_string(), @@ -60,7 +60,10 @@ fn shellcheck_alias_does_not_make_github_backend_obsolete() { ("shellcheck".to_string(), "0.11.0".to_string()), ]); - assert_eq!(find_obsolete_key(&tools), None); + assert_eq!( + find_obsolete_key(&tools), + Some(("github:koalaman/shellcheck", "shellcheck")) + ); } #[test] @@ -71,8 +74,8 @@ fn check_owned_tool_migrations_are_always_actionable() { assert!(obsolete.contains(&("github:owenlamont/ryl", "aqua:owenlamont/ryl"))); assert!(obsolete.contains(&("pipx:ruff", "ruff"))); assert!(obsolete.contains(&("github:astral-sh/ruff", "ruff"))); - assert!(obsolete.contains(&("shellcheck", "github:koalaman/shellcheck"))); - assert!(obsolete.contains(&("cargo:xmloxide", "github:jonwiggins/xmloxide"))); + assert!(obsolete.contains(&("github:koalaman/shellcheck", "shellcheck"))); + assert!(obsolete.contains(&("cargo:xmloxide", "aqua:jonwiggins/xmloxide"))); } #[test] @@ -514,8 +517,9 @@ fn linter_keys_include_mise_and_bare_tool_names() { let keys = linter_keys(); assert!(keys.contains("aqua:owenlamont/ryl")); assert!(keys.contains("ryl")); - assert!(keys.contains("github:jonwiggins/xmloxide")); + assert!(keys.contains("aqua:jonwiggins/xmloxide")); assert!(keys.contains("xmllint")); + assert!(keys.contains("aqua:grafana/flint")); assert!(keys.contains("github:grafana/flint")); assert!(keys.contains("cargo:https://github.com/grafana/flint")); assert!(keys.contains("cargo:https://github.com/grafana/flint.git")); @@ -537,7 +541,7 @@ fn flint_version_changed_detects_cargo_prerelease_rev_changes() { #[test] fn flint_version_changed_detects_release_to_cargo_backend_switch() { - let previous = HashMap::from([("github:grafana/flint".to_string(), "0.20.4".to_string())]); + let previous = HashMap::from([("aqua:grafana/flint".to_string(), "0.20.4".to_string())]); let current = HashMap::from([( "cargo:https://github.com/grafana/flint".to_string(), "rev:bbbb".to_string(), @@ -688,7 +692,7 @@ fn readme_quickstart_tools_snippets_stay_current() { .expect("README install block must contain [tools]"); assert_eq!( install_tools - .get("github:grafana/flint") + .get("aqua:grafana/flint") .and_then(toml::Value::as_str), Some(env!("CARGO_PKG_VERSION")), "README install snippet must pin the current flint release" @@ -710,18 +714,13 @@ fn readme_quickstart_tools_snippets_stay_current() { let expected = toml_tool_versions_from_table(repo_tools, readme_snippets::QUICKSTART_KEYS) .into_iter() .chain(std::iter::once(( - "github:grafana/flint".to_string(), + "aqua:grafana/flint".to_string(), env!("CARGO_PKG_VERSION").to_string(), ))) .collect::>(); let actual = toml_tool_versions_from_table( quickstart_tools, - &[ - "github:grafana/flint", - "github:koalaman/shellcheck", - "shfmt", - "actionlint", - ], + &["aqua:grafana/flint", "shellcheck", "shfmt", "actionlint"], ); assert_eq!( diff --git a/src/setup.rs b/src/setup.rs index 9cf39592..98ac4586 100644 --- a/src/setup.rs +++ b/src/setup.rs @@ -1,6 +1,6 @@ use std::collections::HashMap; -const UNSUPPORTED_KEYS_TO_SETUP_VERSION_2: &[(&str, &str)] = &[ +const UNSUPPORTED_TOOL_KEYS: &[(&str, &str)] = &[ ( "npm:markdownlint-cli", "replace with rumdl and remove markdownlint-era config", @@ -15,21 +15,22 @@ const UNSUPPORTED_KEYS_TO_SETUP_VERSION_2: &[(&str, &str)] = &[ ), ]; +const OBSOLETE_KEYS: &[(&str, &str)] = &[("github:grafana/flint", "aqua:grafana/flint")]; pub fn find_unsupported_key( mise_tools: &HashMap, ) -> Option<(&'static str, &'static str)> { - UNSUPPORTED_KEYS_TO_SETUP_VERSION_2 + UNSUPPORTED_TOOL_KEYS .iter() .find(|(old, _)| mise_tools.contains_key(*old)) .copied() } pub fn obsolete_keys() -> Vec<(&'static str, &'static str)> { - vec![] + OBSOLETE_KEYS.to_vec() } pub fn unsupported_keys() -> Vec<(&'static str, &'static str)> { - UNSUPPORTED_KEYS_TO_SETUP_VERSION_2.to_vec() + UNSUPPORTED_TOOL_KEYS.to_vec() } #[cfg(test)] @@ -38,9 +39,16 @@ mod tests { #[test] fn setup_migration_keys_are_unique() { + let mut obsolete_seen = std::collections::HashSet::new(); let mut unsupported_seen = std::collections::HashSet::new(); - for (old, _) in UNSUPPORTED_KEYS_TO_SETUP_VERSION_2 { + for (old, _) in OBSOLETE_KEYS { + assert!( + obsolete_seen.insert(*old), + "duplicate obsolete setup migration key: {old}" + ); + } + for (old, _) in UNSUPPORTED_TOOL_KEYS { assert!( unsupported_seen.insert(*old), "duplicate unsupported setup migration key: {old}" @@ -50,6 +58,12 @@ mod tests { #[test] fn unsupported_tombstones_are_explicit() { + let obsolete = obsolete_keys(); + assert!( + obsolete + .iter() + .any(|(old, new)| *old == "github:grafana/flint" && *new == "aqua:grafana/flint") + ); let unsupported = unsupported_keys(); assert!( unsupported diff --git a/tests/cases/general/auto-fix-and-review/files/mise.toml b/tests/cases/general/auto-fix-and-review/files/mise.toml index f96613b3..8ecc60a3 100644 --- a/tests/cases/general/auto-fix-and-review/files/mise.toml +++ b/tests/cases/general/auto-fix-and-review/files/mise.toml @@ -1,3 +1,3 @@ [tools] rust = "latest" -"github:koalaman/shellcheck" = "latest" +shellcheck = "latest" diff --git a/tests/cases/general/auto-review-two-linters/files/mise.toml b/tests/cases/general/auto-review-two-linters/files/mise.toml index 920ec25b..a27736f5 100644 --- a/tests/cases/general/auto-review-two-linters/files/mise.toml +++ b/tests/cases/general/auto-review-two-linters/files/mise.toml @@ -1,3 +1,3 @@ [tools] -"github:koalaman/shellcheck" = "latest" +shellcheck = "latest" actionlint = "latest" diff --git a/tests/cases/general/auto-review-unfixable/files/mise.toml b/tests/cases/general/auto-review-unfixable/files/mise.toml index 2481386f..d7259835 100644 --- a/tests/cases/general/auto-review-unfixable/files/mise.toml +++ b/tests/cases/general/auto-review-unfixable/files/mise.toml @@ -1,2 +1,2 @@ [tools] -"github:koalaman/shellcheck" = "latest" +shellcheck = "latest" diff --git a/tests/cases/general/baseline-config-change/files/mise.toml b/tests/cases/general/baseline-config-change/files/mise.toml index 2481386f..d7259835 100644 --- a/tests/cases/general/baseline-config-change/files/mise.toml +++ b/tests/cases/general/baseline-config-change/files/mise.toml @@ -1,2 +1,2 @@ [tools] -"github:koalaman/shellcheck" = "latest" +shellcheck = "latest" diff --git a/tests/cases/general/baseline-excluded-config-change/files/mise.toml b/tests/cases/general/baseline-excluded-config-change/files/mise.toml index 2481386f..d7259835 100644 --- a/tests/cases/general/baseline-excluded-config-change/files/mise.toml +++ b/tests/cases/general/baseline-excluded-config-change/files/mise.toml @@ -1,2 +1,2 @@ [tools] -"github:koalaman/shellcheck" = "latest" +shellcheck = "latest" diff --git a/tests/cases/general/baseline-flint-settings-change/files/mise.toml b/tests/cases/general/baseline-flint-settings-change/files/mise.toml index 2481386f..d7259835 100644 --- a/tests/cases/general/baseline-flint-settings-change/files/mise.toml +++ b/tests/cases/general/baseline-flint-settings-change/files/mise.toml @@ -1,2 +1,2 @@ [tools] -"github:koalaman/shellcheck" = "latest" +shellcheck = "latest" diff --git a/tests/cases/general/baseline-flint-upgrade/changes/mise.toml b/tests/cases/general/baseline-flint-upgrade/changes/mise.toml index 24cb9b54..39d70566 100644 --- a/tests/cases/general/baseline-flint-upgrade/changes/mise.toml +++ b/tests/cases/general/baseline-flint-upgrade/changes/mise.toml @@ -1,3 +1,3 @@ [tools] -"github:koalaman/shellcheck" = "0.11.0" -"github:grafana/flint" = "0.20.3" +shellcheck = "0.11.0" +"aqua:grafana/flint" = "0.20.3" diff --git a/tests/cases/general/baseline-flint-upgrade/files/mise.toml b/tests/cases/general/baseline-flint-upgrade/files/mise.toml index 10ba3457..d65668bf 100644 --- a/tests/cases/general/baseline-flint-upgrade/files/mise.toml +++ b/tests/cases/general/baseline-flint-upgrade/files/mise.toml @@ -1,3 +1,3 @@ [tools] -"github:koalaman/shellcheck" = "0.11.0" -"github:grafana/flint" = "0.20.2" +shellcheck = "0.11.0" +"aqua:grafana/flint" = "0.20.2" diff --git a/tests/cases/general/baseline-new-linter/changes/mise.toml b/tests/cases/general/baseline-new-linter/changes/mise.toml index 2481386f..d7259835 100644 --- a/tests/cases/general/baseline-new-linter/changes/mise.toml +++ b/tests/cases/general/baseline-new-linter/changes/mise.toml @@ -1,2 +1,2 @@ [tools] -"github:koalaman/shellcheck" = "latest" +shellcheck = "latest" diff --git a/tests/cases/general/baseline-tool-upgrade/changes/mise.toml b/tests/cases/general/baseline-tool-upgrade/changes/mise.toml index 0d486f3a..4d3bcc49 100644 --- a/tests/cases/general/baseline-tool-upgrade/changes/mise.toml +++ b/tests/cases/general/baseline-tool-upgrade/changes/mise.toml @@ -1,2 +1,2 @@ [tools] -"github:koalaman/shellcheck" = "0.11.0" +shellcheck = "0.11.0" diff --git a/tests/cases/general/baseline-tool-upgrade/files/mise.toml b/tests/cases/general/baseline-tool-upgrade/files/mise.toml index 0f5a6afd..e256d48f 100644 --- a/tests/cases/general/baseline-tool-upgrade/files/mise.toml +++ b/tests/cases/general/baseline-tool-upgrade/files/mise.toml @@ -1,2 +1,2 @@ [tools] -"github:koalaman/shellcheck" = "0.10.0" +shellcheck = "0.10.0" diff --git a/tests/cases/general/env-var-exclude/files/mise.toml b/tests/cases/general/env-var-exclude/files/mise.toml index 2481386f..d7259835 100644 --- a/tests/cases/general/env-var-exclude/files/mise.toml +++ b/tests/cases/general/env-var-exclude/files/mise.toml @@ -1,2 +1,2 @@ [tools] -"github:koalaman/shellcheck" = "latest" +shellcheck = "latest" diff --git a/tests/cases/general/exclude-paths/files/mise.toml b/tests/cases/general/exclude-paths/files/mise.toml index 2481386f..d7259835 100644 --- a/tests/cases/general/exclude-paths/files/mise.toml +++ b/tests/cases/general/exclude-paths/files/mise.toml @@ -1,2 +1,2 @@ [tools] -"github:koalaman/shellcheck" = "latest" +shellcheck = "latest" diff --git a/tests/cases/general/flint-setup-obsolete-key/test.toml b/tests/cases/general/flint-setup-obsolete-key/test.toml index 26ebc7dd..29d93838 100644 --- a/tests/cases/general/flint-setup-obsolete-key/test.toml +++ b/tests/cases/general/flint-setup-obsolete-key/test.toml @@ -9,8 +9,8 @@ stderr = "flint: fixed: flint-setup — commit before pushing\n" [tools] # Linters -"github:koalaman/shellcheck" = "v0.11.0" ruff = "0.15.0" +shellcheck = "v0.11.0" ''' "flint.toml" = ''' [settings] diff --git a/tests/cases/general/flint-setup-unaffected-old-version/files/mise.toml b/tests/cases/general/flint-setup-unaffected-old-version/files/mise.toml index c85bbaaa..848f782c 100644 --- a/tests/cases/general/flint-setup-unaffected-old-version/files/mise.toml +++ b/tests/cases/general/flint-setup-unaffected-old-version/files/mise.toml @@ -1,4 +1,4 @@ [tools] # Linters -"github:koalaman/shellcheck" = "v0.11.0" +shellcheck = "v0.11.0" diff --git a/tests/cases/general/init-idempotent/files/mise.toml b/tests/cases/general/init-idempotent/files/mise.toml index 2105876c..c8f689fc 100644 --- a/tests/cases/general/init-idempotent/files/mise.toml +++ b/tests/cases/general/init-idempotent/files/mise.toml @@ -6,7 +6,7 @@ actionlint = "1.0.0" "aqua:owenlamont/ryl" = "1.0.0" biome = "1.0.0" editorconfig-checker = "1.0.0" -"github:grafana/flint" = "1.0.0" +"aqua:grafana/flint" = "1.0.0" lychee = "1.0.0" "pipx:codespell" = "1.0.0" rumdl = "1.0.0" diff --git a/tests/cases/general/init-idempotent/test.toml b/tests/cases/general/init-idempotent/test.toml index b7bdae4d..f9a1bd03 100644 --- a/tests/cases/general/init-idempotent/test.toml +++ b/tests/cases/general/init-idempotent/test.toml @@ -4,5 +4,7 @@ exit = 0 stdout = ''' Tip: flint init detects languages from tracked files (`git ls-files`). Add and stage your source files before running init so the detection is accurate. -No changes to apply. + normalized [tools] in /mise.toml +installed pre-commit hook (.git/hooks/pre-commit) +Done. Run `mise install` to install the new tools. ''' diff --git a/tests/cases/general/time-flag/files/mise.toml b/tests/cases/general/time-flag/files/mise.toml index 920ec25b..a27736f5 100644 --- a/tests/cases/general/time-flag/files/mise.toml +++ b/tests/cases/general/time-flag/files/mise.toml @@ -1,3 +1,3 @@ [tools] -"github:koalaman/shellcheck" = "latest" +shellcheck = "latest" actionlint = "latest" diff --git a/tests/cases/general/unsupported-alternate-config/files/mise.toml b/tests/cases/general/unsupported-alternate-config/files/mise.toml index 2481386f..d7259835 100644 --- a/tests/cases/general/unsupported-alternate-config/files/mise.toml +++ b/tests/cases/general/unsupported-alternate-config/files/mise.toml @@ -1,2 +1,2 @@ [tools] -"github:koalaman/shellcheck" = "latest" +shellcheck = "latest" diff --git a/tests/cases/google-java-format/auto-fix/files/mise.toml b/tests/cases/google-java-format/auto-fix/files/mise.toml index eb0a01b3..0f1c7e68 100644 --- a/tests/cases/google-java-format/auto-fix/files/mise.toml +++ b/tests/cases/google-java-format/auto-fix/files/mise.toml @@ -1,2 +1,2 @@ [tools] -"github:google/google-java-format" = "latest" +"google-java-format" = "latest" diff --git a/tests/cases/google-java-format/clean/files/mise.toml b/tests/cases/google-java-format/clean/files/mise.toml index eb0a01b3..0f1c7e68 100644 --- a/tests/cases/google-java-format/clean/files/mise.toml +++ b/tests/cases/google-java-format/clean/files/mise.toml @@ -1,2 +1,2 @@ [tools] -"github:google/google-java-format" = "latest" +"google-java-format" = "latest" diff --git a/tests/cases/google-java-format/failure/files/mise.toml b/tests/cases/google-java-format/failure/files/mise.toml index eb0a01b3..0f1c7e68 100644 --- a/tests/cases/google-java-format/failure/files/mise.toml +++ b/tests/cases/google-java-format/failure/files/mise.toml @@ -1,2 +1,2 @@ [tools] -"github:google/google-java-format" = "latest" +"google-java-format" = "latest" diff --git a/tests/cases/shellcheck/clean/files/mise.toml b/tests/cases/shellcheck/clean/files/mise.toml index 2481386f..d7259835 100644 --- a/tests/cases/shellcheck/clean/files/mise.toml +++ b/tests/cases/shellcheck/clean/files/mise.toml @@ -1,2 +1,2 @@ [tools] -"github:koalaman/shellcheck" = "latest" +shellcheck = "latest" diff --git a/tests/cases/shellcheck/config-dir/files/mise.toml b/tests/cases/shellcheck/config-dir/files/mise.toml index 2481386f..d7259835 100644 --- a/tests/cases/shellcheck/config-dir/files/mise.toml +++ b/tests/cases/shellcheck/config-dir/files/mise.toml @@ -1,2 +1,2 @@ [tools] -"github:koalaman/shellcheck" = "latest" +shellcheck = "latest" diff --git a/tests/cases/shellcheck/failure/files/mise.toml b/tests/cases/shellcheck/failure/files/mise.toml index 2481386f..d7259835 100644 --- a/tests/cases/shellcheck/failure/files/mise.toml +++ b/tests/cases/shellcheck/failure/files/mise.toml @@ -1,2 +1,2 @@ [tools] -"github:koalaman/shellcheck" = "latest" +shellcheck = "latest" diff --git a/tests/cases/shellcheck/sourced-file/files/mise.toml b/tests/cases/shellcheck/sourced-file/files/mise.toml index 2481386f..d7259835 100644 --- a/tests/cases/shellcheck/sourced-file/files/mise.toml +++ b/tests/cases/shellcheck/sourced-file/files/mise.toml @@ -1,2 +1,2 @@ [tools] -"github:koalaman/shellcheck" = "latest" +shellcheck = "latest" diff --git a/tests/cases/xmllint/clean/files/mise.toml b/tests/cases/xmllint/clean/files/mise.toml index 8b17fe31..a3cde65c 100644 --- a/tests/cases/xmllint/clean/files/mise.toml +++ b/tests/cases/xmllint/clean/files/mise.toml @@ -1,2 +1,2 @@ [tools] -"github:jonwiggins/xmloxide" = "v0.4.2" +"aqua:jonwiggins/xmloxide" = "v0.4.2" diff --git a/tests/cases/xmllint/failure/files/mise.toml b/tests/cases/xmllint/failure/files/mise.toml index 8b17fe31..a3cde65c 100644 --- a/tests/cases/xmllint/failure/files/mise.toml +++ b/tests/cases/xmllint/failure/files/mise.toml @@ -1,2 +1,2 @@ [tools] -"github:jonwiggins/xmloxide" = "v0.4.2" +"aqua:jonwiggins/xmloxide" = "v0.4.2"