Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 2 additions & 28 deletions tests/compile-test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use cargo_metadata::Message;
use cargo_metadata::diagnostic::{Applicability, Diagnostic};
use clippy_config::ClippyConfiguration;
use clippy_lints::declared_lints::LINTS;
use clippy_lints::deprecated_lints::{DEPRECATED, DEPRECATED_VERSION, RENAMED};
use clippy_lints::deprecated_lints::RENAMED;
use declare_clippy_lint::LintInfo;
use pulldown_cmark::{Options, Parser, html};
use serde::Deserialize;
Expand All @@ -27,7 +27,7 @@ use std::ffi::{OsStr, OsString};
use std::fmt::Write;
use std::path::{Path, PathBuf};
use std::sync::mpsc::{Sender, channel};
use std::{fs, iter, thread};
use std::{fs, thread};

mod test_utils;

Expand Down Expand Up @@ -503,10 +503,6 @@ impl DiagnosticCollector {
let mut metadata: Vec<LintMetadata> = LINTS
.iter()
.map(|lint| LintMetadata::new(lint, &applicabilities, &configs))
.chain(
iter::zip(DEPRECATED, DEPRECATED_VERSION)
.map(|((lint, reason), version)| LintMetadata::new_deprecated(lint, reason, version)),
)
.collect();

metadata.sort_unstable_by(|a, b| a.id.cmp(&b.id));
Expand Down Expand Up @@ -605,28 +601,6 @@ impl LintMetadata {
}
}

fn new_deprecated(name: &str, reason: &str, version: &'static str) -> Self {
// The reason starts with a lowercase letter and ends without a period.
// This needs to be fixed for the website.
let mut reason = reason.to_owned();
if let Some(reason) = reason.get_mut(0..1) {
reason.make_ascii_uppercase();
}
Self {
id: name.strip_prefix("clippy::").unwrap().into(),
id_location: None,
group: "deprecated",
level: "none",
docs: format!(
"### What it does\n\n\
Nothing. This lint has been deprecated\n\n\
### Deprecation reason\n\n{reason}.\n",
),
version,
applicability: Applicability::Unspecified,
}
}

fn applicability_str(&self) -> &str {
match self.applicability {
Applicability::MachineApplicable => "MachineApplicable",
Expand Down
3 changes: 0 additions & 3 deletions util/gh-pages/index_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,6 @@ <h1 class="page-header">Clippy Lints <span id="lint-count" class="badge"></span>
<li class="checkbox"> {# #}
<button onclick="toggleElements('groups_filter', true)">All</button> {# #}
</li> {# #}
<li class="checkbox"> {# #}
<button onclick="resetGroupsToDefault()">Default</button> {# #}
</li> {# #}
<li class="checkbox"> {# #}
<button onclick="toggleElements('groups_filter', false)">None</button> {# #}
</li> {# #}
Expand Down
25 changes: 1 addition & 24 deletions util/gh-pages/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ const GROUPS_FILTER_DEFAULT = {
restriction: true,
style: true,
suspicious: true,
deprecated: false,
};
const LEVEL_FILTERS_DEFAULT = {
allow: true,
Expand Down Expand Up @@ -394,28 +393,6 @@ function clearVersionFilters() {
}
}

function resetGroupsToDefault() {
let needsUpdate = false;
let count = 0;

onEachLazy(document.querySelectorAll("#lint-groups-selector input"), el => {
const key = el.getAttribute("data-value");
const value = GROUPS_FILTER_DEFAULT[key];
if (filters.groups_filter[key] !== value) {
filters.groups_filter[key] = value;
el.checked = value;
needsUpdate = true;
}
if (value) {
count += 1;
}
});
document.querySelector("#lint-groups .badge").innerText = count;
if (needsUpdate) {
filters.filterLints();
}
}

function generateListOfOptions(list, elementId, filter) {
let html = '';
let nbEnabled = 0;
Expand Down Expand Up @@ -594,7 +571,7 @@ addListeners();
highlightLazily();

function updateLintCount() {
const allLints = filters.getAllLints().filter(lint => lint.group != "deprecated");
const allLints = filters.getAllLints();
const totalLints = allLints.length;

const countElement = document.getElementById("lint-count");
Expand Down
3 changes: 0 additions & 3 deletions util/gh-pages/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,6 @@ article:hover .panel-title-name .anchor { display: inline;}
.lint-group {
min-width: 8em;
}
.group-deprecated {
opacity: 0.5;
}

.doc-folding {
color: #000;
Expand Down