Skip to content

Commit

Permalink
list the repos that use www.github.com on the users page
Browse files Browse the repository at this point in the history
  • Loading branch information
szabgab committed Apr 7, 2024
1 parent fdf34f7 commit a9abeac
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 5 deletions.
12 changes: 12 additions & 0 deletions src/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,18 @@ pub fn generate_user_pages(
})
.collect::<Vec<_>>(),
);

problems.insert(
"vcs_with_www",
selected_crates
.iter()
.filter(|krate| {
!krate.repository.is_empty()
&& krate.repository.starts_with("https://www.github.com")
})
.collect::<Vec<_>>(),
);

problems.insert(
"both_rustfm_and_dot_rustfmt",
selected_crates
Expand Down
22 changes: 18 additions & 4 deletions templates/incl/list_crate_errors.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,43 @@
</thead>
<tbody>

{% if problems["vcs_with_www"].size > 0 %}
<h2 class="title">VCS URL <b>www.github.com</b> instead of <b>github.com</b></h2>

See <a href="/about-repository#www">explanation</a>.

{% for crate in problems["vcs_with_www"] %}
<tr>
<td><a href="/crates/{{crate.name}}">{{crate.name}}</a></td>
<td><a href="{{crate.repository}}"><span class="tag is-danger is-light">repo</span></a></td>
</tr>
{% endfor %}
{% endif %}


{% if problems["vcs_with_http"].size > 0 %}
<h2 class="title"><span class="tag is-danger is-light">VCS URL starting with <b>http</b> instead of <b>https</b></span></h2>
<h2 class="title">VCS URL starting with <b>http</b> instead of <b>https</b></h2>

See <a href="/about-repository#https">explanation</a>.

{% for crate in problems["vcs_with_http"] %}
<tr>
<td><a href="/crates/{{crate.name}}">{{crate.name}}</a></td>
<td><a href="{{crate.repository}}">repo</a></td>
<td><a href="{{crate.repository}}"><span class="tag is-danger is-light">repo</span></a></td>
</tr>
{% endfor %}
{% endif %}


{% if problems["both_rustfm_and_dot_rustfmt"].size > 0 %}
<h2 class="title"><span class="tag is-danger is-light">Has both rustfmt.toml and .rustfmt.toml</span></h2>
<h2 class="title">Has both rustfmt.toml and .rustfmt.toml</h2>

One of them is disregarded

{% for crate in problems["both_rustfm_and_dot_rustfmt"] %}
<tr>
<td><a href="/crates/{{crate.name}}">{{crate.name}}</a></td>
<td><a href="{{crate.repository}}">repo</a></td>
<td><a href="{{crate.repository}}"><span class="tag is-danger is-light">repo</span></a></td>
</tr>
{% endfor %}
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion templates/user.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ <h1 class="title">{{title}}</h1>

{% include 'templates/incl/list_crate_errors.html' %}

<h2 class="title is-5">Crates</h2>
<h2 class="title">Crates</h2>
{% include 'templates/incl/list_crates.html' %}

</div>
Expand Down

0 comments on commit a9abeac

Please sign in to comment.