3 Welcome to a Clippy's lint list, at least the source code of it. If you are
4 interested in contributing to this website checkout `util/gh-pages/index.html`
5 inside the rust-clippy repository.
7 Otherwise, have a great day =^.^=
11 <meta charset="UTF-8"/>
12 <meta name="viewport" content="width=device-width, initial-scale=1"/>
13 <meta name="description" content="A collection of lints to catch common mistakes and improve your Rust code.">
15 <title>Clippy Lints</title>
17 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.min.css"/>
18 <link id="githubLightHighlight" rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.6.0/styles/github.min.css" disabled="true" />
19 <link id="githubDarkHighlight" rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.6.0/styles/github-dark.min.css" disabled="true" />
21 <!-- The files are not copied over into the Clippy project since they use the MPL-2.0 License -->
22 <link rel="stylesheet" href="https://rust-lang.github.io/mdBook/css/variables.css"/>
23 <link id="styleHighlight" rel="stylesheet" href="https://rust-lang.github.io/mdBook/highlight.css">
24 <link id="styleNight" rel="stylesheet" href="https://rust-lang.github.io/mdBook/tomorrow-night.css" disabled="true">
25 <link id="styleAyu" rel="stylesheet" href="https://rust-lang.github.io/mdBook/ayu-highlight.css" disabled="true">
27 blockquote { font-size: 1em; }
28 [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak { display: none !important; }
32 background: var(--theme-popup-bg);
33 border: 1px solid var(--theme-popup-border);
36 .dropdown-menu .divider {
37 background-color: var(--theme-popup-border);
40 .dropdown-menu .checkbox {
45 .dropdown-menu .checkbox label {
50 .dropdown-menu .checkbox input {
56 .dropdown-menu .checkbox:hover {
57 background-color: var(--theme-hover);
60 div.panel div.panel-body button.dropdown-toggle {
61 background: var(--searchbar-bg);
62 color: var(--searchbar-fg);
63 border-color: var(--theme-popup-border);
66 div.panel div.panel-body button.dropdown-toggle:hover {
67 box-shadow: 0 0 3px var(--searchbar-shadow-color);
70 div.panel div.panel-body .open button.dropdown-toggle {
71 background: var(--searchbar-bg);
72 color: var(--searchbar-fg);
73 border-color: var(--theme-popup-border);
74 filter: brightness(90%);
77 .dropdown-toggle .badge {
78 background-color: #777;
81 .panel-heading { cursor: pointer; }
83 .panel-title { display: flex; flex-wrap: wrap;}
84 .panel-title .label { display: inline-block; }
86 .panel-title-name { flex: 1; min-width: 400px;}
87 .panel-title-name span { vertical-align: bottom; }
89 .panel .panel-title-name .anchor { display: none; }
90 .panel:hover .panel-title-name .anchor { display: inline;}
96 @media (min-width: 992px) {
103 @media (min-width: 405px) {
109 @media (max-width: 430px) {
110 /* Turn the version filter list to the left */
111 #version-filter-selector {
117 @media (max-width: 412px) {
119 .panel-body .search-control {
127 padding-bottom: 0.3em;
137 .label-lint-level-allow {
138 background-color: #5cb85c;
140 .label-lint-level-warn {
141 background-color: #f0ad4e;
143 .label-lint-level-deny {
144 background-color: #d9534f;
146 .label-lint-level-none {
147 background-color: #777777;
151 .label-group-deprecated {
157 background-color: #fff;
158 border: 1px solid var(--theme-popup-border);
160 .label-doc-folding:hover {
161 background-color: #e6e6e6;
165 border-top: 1px solid var(--theme-popup-border);
170 .lint-doc-md > h3:first-child {
175 @media (max-width:749px) {
176 .lint-additional-info-container {
180 .lint-additional-info-item + .lint-additional-info-item {
181 border-top: 1px solid var(--theme-popup-border);
184 @media (min-width:750px) {
185 .lint-additional-info-container {
189 .lint-additional-info-item + .lint-additional-info-item {
190 border-left: 1px solid var(--theme-popup-border);
194 .lint-additional-info-item {
195 display: inline-flex;
198 padding: 9px 5px 5px 15px;
201 .label-applicability {
202 background-color: #777777;
207 background-color: #777777;
209 font-family: monospace;
214 padding: .5em .5em 0;
218 white-space: pre !important;
223 margin: -.5em -.5em 0;
233 /* Expanding the mdBoom theme*/
235 --inline-code-bg: #f6f7f6;
238 --inline-code-bg: #f6f7f6;
241 --inline-code-bg: #1d1f21;
244 --inline-code-bg: #1d1f21;
247 --inline-code-bg: #191f26;
256 /* Applying the mdBook theme */
262 border: solid 1px var(--icons);
268 background: var(--theme-hover);
273 border: 1px solid var(--theme-popup-border);
276 background: var(--theme-popup-bg);
281 .theme-dropdown.open .theme-choice {
292 .theme-choice > li:hover {
293 background: var(--theme-hover);
298 background: var(--theme-hover);
299 border: 1px solid var(--theme-popup-border);
302 border-color: var(--theme-popup-border);
304 .panel-default > .panel-heading {
305 background: var(--theme-hover);
307 border: 1px solid var(--theme-popup-border);
309 .panel-default > .panel-heading:hover {
310 filter: brightness(90%);
314 border: 1px solid var(--theme-popup-border);
317 background: var(--bg);
318 border: 1px solid var(--theme-popup-border);
321 #version-filter-selector .checkbox {
326 min-width: available;
329 #version-filter li label {
334 .version-filter-input {
339 border-bottom: 1px solid #000000;
342 #filter-label, .filter-clear {
343 background: var(--searchbar-bg);
344 color: var(--searchbar-fg);
345 border-color: var(--theme-popup-border);
346 filter: brightness(95%);
348 #filter-label:hover, .filter-clear:hover {
349 filter: brightness(90%);
352 background: var(--searchbar-bg);
353 color: var(--searchbar-fg);
354 border-color: var(--theme-popup-border);
357 .filter-input::-webkit-input-placeholder,
358 .filter-input::-moz-placeholder {
359 color: var(--searchbar-fg);
364 color: var(--inline-code-color);
365 background-color: var(--inline-code-bg);
368 scrollbar-color: var(--scrollbar) var(--bg);
371 background: var(--bg);
377 <body ng-app="clippy" ng-controller="lintList">
378 <div theme-dropdown class="theme-dropdown">
379 <div id="theme-icon" class="theme-icon">🖌</div>
380 <ul id="theme-menu" class="theme-choice">
381 <li id="{{id}}" ng-repeat="(id, name) in themes" ng-click="selectTheme(id)">{{name}}</li>
385 <div class="container">
386 <div class="page-header">
387 <h1>Clippy Lints</h1>
391 <div class="alert alert-danger" role="alert">
392 Sorry, this site only works with JavaScript! :(
398 <div class="alert alert-info" role="alert" ng-if="loading">
401 <div class="alert alert-danger" role="alert" ng-if="error">
405 <div class="panel panel-default" ng-show="data">
406 <div class="panel-body row">
407 <div id="upper-filters" class="col-12 col-md-4">
408 <div class="btn-group" filter-dropdown>
409 <button type="button" class="btn btn-default dropdown-toggle">
410 Lint levels <span class="badge">{{selectedValuesCount(levels)}}</span> <span class="caret"></span>
412 <ul class="dropdown-menu">
413 <li class="checkbox">
414 <label ng-click="toggleLevels(true)">
415 <input type="checkbox" class="invisible" />
419 <li class="checkbox">
420 <label ng-click="toggleLevels(false)">
421 <input type="checkbox" class="invisible" />
425 <li role="separator" class="divider"></li>
426 <li class="checkbox" ng-repeat="(level, enabled) in levels">
427 <label class="text-capitalize">
428 <input type="checkbox" ng-model="levels[level]" />
434 <div class="btn-group" filter-dropdown>
435 <button type="button" class="btn btn-default dropdown-toggle">
436 Lint groups <span class="badge">{{selectedValuesCount(groups)}}</span> <span class="caret"></span>
438 <ul class="dropdown-menu">
439 <li class="checkbox">
440 <label ng-click="toggleGroups(true)">
441 <input type="checkbox" class="invisible" />
445 <li class="checkbox">
446 <label ng-click="toggleGroups(false)">
447 <input type="checkbox" class="invisible" />
451 <li role="separator" class="divider"></li>
452 <li class="checkbox" ng-repeat="(group, enabled) in groups">
453 <label class="text-capitalize">
454 <input type="checkbox" ng-model="groups[group]" />
460 <div id="version-filter">
461 <div class="btn-group" filter-dropdown>
462 <button type="button" class="btn btn-default dropdown-toggle">
464 <span id="version-filter-count" class="badge">
465 {{versionFilterCount(versionFilters)}}
467 <span class="caret"></span>
469 <ul id="version-filter-selector" class="dropdown-menu">
470 <li class="checkbox">
471 <label ng-click="clearVersionFilters()">
472 <input type="checkbox" class="invisible" />
476 <li role="separator" class="divider"></li>
477 <li class="checkbox" ng-repeat="(filter, vars) in versionFilters">
478 <label ng-attr-for="filter-{filter}">{{filter}}</label>
482 ng-attr-id="filter-{filter}"
483 class="version-filter-input form-control filter-input"
485 ng-model="versionFilters[filter].minorVersion"
486 ng-model-options="{debounce: 50}"
487 ng-change="updateVersionFilters()" />
495 <div class="col-12 col-md-7 search-control">
496 <div class="input-group">
497 <label class="input-group-addon" id="filter-label" for="search-input">Filter:</label>
498 <input type="text" class="form-control filter-input" placeholder="Keywords or search string" id="search-input" ng-model="search" ng-model-options="{debounce: 50}"/>
499 <span class="input-group-btn">
500 <button class="filter-clear btn" type="button" ng-click="search = ''">
508 <!-- The order of the filters should be from most likely to remove a lint to least likely to improve performance. -->
509 <article class="panel panel-default" id="{{lint.id}}" ng-repeat="lint in data | filter:bySearch | filter:byGroups | filter:byLevels | filter:byVersion">
510 <header class="panel-heading" ng-click="open[lint.id] = !open[lint.id]">
511 <h2 class="panel-title">
512 <div class="panel-title-name">
513 <span>{{lint.id}}</span>
514 <a href="#{{lint.id}}" class="anchor label label-default" ng-click="open[lint.id] = true; $event.stopPropagation()">¶</a>
515 <a href="" id="clipboard-{{lint.id}}" class="anchor label label-default" ng-click="copyToClipboard(lint); $event.stopPropagation()">
520 <div class="panel-title-addons">
521 <span class="label label-lint-group label-default label-group-{{lint.group}}">{{lint.group}}</span>
523 <span class="label label-lint-level label-lint-level-{{lint.level}}">{{lint.level}}</span>
526 <span class="label label-doc-folding" ng-show="open[lint.id]">−</span>
527 <span class="label label-doc-folding" ng-hide="open[lint.id]">+</span>
532 <div class="list-group lint-docs" ng-if="open[lint.id]" ng-class="{collapse: true, in: open[lint.id]}">
533 <div class="list-group-item lint-doc-md" ng-bind-html="lint.docs | markdown"></div>
534 <div class="lint-additional-info-container">
535 <!-- Applicability -->
536 <div class="lint-additional-info-item">
537 <span> Applicability: </span>
538 <span class="label label-default label-applicability">{{lint.applicability.applicability}}</span>
539 <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint_defs/enum.Applicability.html#variants">(?)</a>
541 <!-- Clippy version -->
542 <div class="lint-additional-info-item">
543 <span>{{lint.group == "deprecated" ? "Deprecated" : "Added"}} in: </span>
544 <span class="label label-default label-version">{{lint.version}}</span>
546 <!-- Open related issues -->
547 <div class="lint-additional-info-item">
548 <a href="https://github.com/rust-lang/rust-clippy/issues?q=is%3Aissue+{{lint.id}}">Related Issues</a>
550 <!-- Jump to source -->
551 <div class="lint-additional-info-item">
552 <a href="https://github.com/rust-lang/rust-clippy/blob/{{docVersion}}/clippy_lints/{{lint.id_span.path}}#L{{lint.id_span.line}}">View Source</a>
560 <a href="https://github.com/rust-lang/rust-clippy">
561 <img style="position: absolute; top: 0; right: 0; border: 0; clip-path: polygon(0% 0%, 100% 0%, 100% 100%);" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on Github"/>
564 <script src="https://cdnjs.cloudflare.com/ajax/libs/markdown-it/12.3.2/markdown-it.min.js"></script>
565 <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.6.0/highlight.min.js"></script>
566 <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.6.0/languages/rust.min.js"></script>
567 <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.12/angular.min.js"></script>
568 <script src="script.js"></script>