From 0ea413fe6b6acd4b30e5e96ffe6d73882b22e8b7 Mon Sep 17 00:00:00 2001 From: Alex Macleod Date: Tue, 5 Aug 2025 10:35:28 +0000 Subject: [PATCH] Generate lint count in template --- tests/compile-test.rs | 8 +++++++- util/gh-pages/index_template.html | 2 +- util/gh-pages/script.js | 12 ------------ 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/tests/compile-test.rs b/tests/compile-test.rs index 664a748ee21e..6b6dfd7b81ea 100644 --- a/tests/compile-test.rs +++ b/tests/compile-test.rs @@ -433,6 +433,7 @@ fn ui_cargo_toml_metadata() { #[derive(Template)] #[template(path = "index_template.html")] struct Renderer<'a> { + count: usize, lints: &'a Vec, } @@ -512,7 +513,12 @@ impl DiagnosticCollector { fs::write( "util/gh-pages/index.html", - Renderer { lints: &metadata }.render().unwrap(), + Renderer { + count: LINTS.len(), + lints: &metadata, + } + .render() + .unwrap(), ) .unwrap(); }); diff --git a/util/gh-pages/index_template.html b/util/gh-pages/index_template.html index 5d65ea585df6..327ccf6439e4 100644 --- a/util/gh-pages/index_template.html +++ b/util/gh-pages/index_template.html @@ -49,7 +49,7 @@ {# #}
{# #} -

Clippy Lints

{# #} +

Clippy Lints Total number: {{+ count }}

{# #}