Skip to content

Commit

Permalink
add list and stats entry for repos without Cargo.toml in the root
Browse files Browse the repository at this point in the history
  • Loading branch information
szabgab committed Apr 1, 2024
1 parent 194c399 commit f9264d0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,13 @@ pub fn generate_pages(crates: &[Crate]) -> Result<(), Box<dyn Error>> {
|krate| krate.details.cargo_toml_in_root,
)?;

let has_no_cargo_toml_in_root = render_filtered_crates(
"has-no-cargo-toml-in-root",
"Has no Cargo.toml file in the root",
crates,
|krate| !krate.details.cargo_toml_in_root,
)?;

let has_rustfmt_toml = render_filtered_crates(
"has-rustfmt-toml",
"Has rustfmt.toml file",
Expand Down Expand Up @@ -603,6 +610,7 @@ pub fn generate_pages(crates: &[Crate]) -> Result<(), Box<dyn Error>> {
("has_dot_rustfmt_toml", has_dot_rustfmt_toml),
("has_both_rustfmt_toml", has_both_rustfmt_toml),
("has_cargo_toml_in_root", has_cargo_toml_in_root),
("has_no_cargo_toml_in_root", has_no_cargo_toml_in_root),
]);

render_stats_page(crates.len(), &stats);
Expand Down
5 changes: 5 additions & 0 deletions templates/stats.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ <h1 class="title">Rust Digger Stats</h1>
<td>{{stats.has_cargo_toml_in_root | commafy}}</td>
<td>{{percentage.has_cargo_toml_in_root}}%</td>
</tr>
<tr>
<td><a href="/has-no-cargo-toml-in-root">Has no Cargo.toml in root</a></td>
<td>{{stats.has_no_cargo_toml_in_root | commafy}}</td>
<td>{{percentage.has_no_cargo_toml_in_root}}%</td>
</tr>
</tbody>
</table>
</div>
Expand Down

0 comments on commit f9264d0

Please sign in to comment.