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 rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.5.0/styles/github.min.css"/>
20 <!-- The files are not copied over into the Clippy project since they use the MPL-2.0 License -->
21 <link rel="stylesheet" href="https://rust-lang.github.io/mdBook/css/variables.css"/>
22 <link id="styleHighlight" rel="stylesheet" href="https://rust-lang.github.io/mdBook/highlight.css">
23 <link id="styleNight" rel="stylesheet" href="https://rust-lang.github.io/mdBook/tomorrow-night.css" disabled="true">
24 <link id="styleAyu" rel="stylesheet" href="https://rust-lang.github.io/mdBook/ayu-highlight.css" disabled="true">
26 blockquote { font-size: 1em; }
27 [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak { display: none !important; }
31 background: var(--theme-popup-bg);
32 border: 1px solid var(--theme-popup-border);
35 .dropdown-menu .divider {
36 background-color: var(--theme-popup-border);
39 .dropdown-menu .checkbox {
44 .dropdown-menu .checkbox label {
49 .dropdown-menu .checkbox input {
55 .dropdown-menu .checkbox:hover {
56 background-color: var(--theme-hover);
59 div.panel div.panel-body button.dropdown-toggle {
60 background: var(--searchbar-bg);
61 color: var(--searchbar-fg);
62 border-color: var(--theme-popup-border);
65 div.panel div.panel-body button.dropdown-toggle:hover {
66 box-shadow: 0 0 3px var(--searchbar-shadow-color);
69 div.panel div.panel-body .open button.dropdown-toggle {
70 background: var(--searchbar-bg);
71 color: var(--searchbar-fg);
72 border-color: var(--theme-popup-border);
73 filter: brightness(90%);
76 .dropdown-toggle .badge {
77 background-color: #777;
80 .panel-heading { cursor: pointer; }
82 .panel-title { display: flex; flex-wrap: wrap;}
83 .panel-title .label { display: inline-block; }
85 .panel-title-name { flex: 1; min-width: 400px;}
86 .panel-title-name span { vertical-align: bottom; }
88 .panel .panel-title-name .anchor { display: none; }
89 .panel:hover .panel-title-name .anchor { display: inline;}
95 @media (min-width: 992px) {
102 @media (min-width: 405px) {
108 @media (max-width: 430px) {
109 /* Turn the version filter list to the left */
110 #version-filter-selector {
116 @media (max-width: 412px) {
118 .panel-body .search-control {
126 padding-bottom: 0.3em;
136 .label-lint-level-allow {
137 background-color: #5cb85c;
139 .label-lint-level-warn {
140 background-color: #f0ad4e;
142 .label-lint-level-deny {
143 background-color: #d9534f;
145 .label-lint-level-none {
146 background-color: #777777;
150 .label-group-deprecated {
156 background-color: #fff;
157 border: 1px solid var(--theme-popup-border);
159 .label-doc-folding:hover {
160 background-color: #e6e6e6;
164 border-top: 1px solid var(--theme-popup-border);
169 .lint-doc-md > h3:first-child {
174 @media (max-width:749px) {
175 .lint-additional-info-container {
179 .lint-additional-info-item + .lint-additional-info-item {
180 border-top: 1px solid var(--theme-popup-border);
183 @media (min-width:750px) {
184 .lint-additional-info-container {
188 .lint-additional-info-item + .lint-additional-info-item {
189 border-left: 1px solid var(--theme-popup-border);
193 .lint-additional-info-item {
194 display: inline-flex;
197 padding: 9px 5px 5px 15px;
200 .label-applicability {
201 background-color: #777777;
206 background-color: #777777;
208 font-family: monospace;
213 padding: .5em .5em 0;
217 white-space: pre !important;
222 margin: -.5em -.5em 0;
232 /* Expanding the mdBoom theme*/
234 --inline-code-bg: #f6f7f6;
237 --inline-code-bg: #f6f7f6;
240 --inline-code-bg: #1d1f21;
243 --inline-code-bg: #1d1f21;
246 --inline-code-bg: #191f26;
255 /* Applying the mdBook theme */
261 border: solid 1px var(--icons);
267 background: var(--theme-hover);
272 border: 1px solid var(--theme-popup-border);
275 background: var(--theme-popup-bg);
280 .theme-dropdown.open .theme-choice {
291 .theme-choice > li:hover {
292 background: var(--theme-hover);
297 background: var(--theme-hover);
298 border: 1px solid var(--theme-popup-border);
301 border-color: var(--theme-popup-border);
303 .panel-default > .panel-heading {
304 background: var(--theme-hover);
306 border: 1px solid var(--theme-popup-border);
308 .panel-default > .panel-heading:hover {
309 filter: brightness(90%);
313 border: 1px solid var(--theme-popup-border);
316 background: var(--bg);
317 border: 1px solid var(--theme-popup-border);
320 #version-filter-selector .checkbox {
325 min-width: available;
328 #version-filter li label {
333 .version-filter-input {
338 border-bottom: 1px solid #000000;
341 #filter-label, .filter-clear {
342 background: var(--searchbar-bg);
343 color: var(--searchbar-fg);
344 border-color: var(--theme-popup-border);
345 filter: brightness(95%);
347 #filter-label:hover, .filter-clear:hover {
348 filter: brightness(90%);
351 background: var(--searchbar-bg);
352 color: var(--searchbar-fg);
353 border-color: var(--theme-popup-border);
356 .filter-input::-webkit-input-placeholder,
357 .filter-input::-moz-placeholder {
358 color: var(--searchbar-fg);
363 color: var(--inline-code-color);
364 background-color: var(--inline-code-bg);
367 scrollbar-color: var(--scrollbar) var(--bg);
370 background: var(--bg);
376 <body ng-app="clippy" ng-controller="lintList">
377 <div theme-dropdown class="theme-dropdown">
378 <div id="theme-icon" class="theme-icon">🖌</div>
379 <ul id="theme-menu" class="theme-choice">
380 <li id="{{id}}" ng-repeat="(id, name) in themes" ng-click="selectTheme(id)">{{name}}</li>
384 <div class="container">
385 <div class="page-header">
386 <h1>Clippy Lints</h1>
390 <div class="alert alert-danger" role="alert">
391 Sorry, this site only works with JavaScript! :(
397 <div class="alert alert-info" role="alert" ng-if="loading">
400 <div class="alert alert-danger" role="alert" ng-if="error">
404 <div class="panel panel-default" ng-show="data">
405 <div class="panel-body row">
406 <div id="upper-filters" class="col-12 col-md-4">
407 <div class="btn-group" filter-dropdown>
408 <button type="button" class="btn btn-default dropdown-toggle">
409 Lint levels <span class="badge">{{selectedValuesCount(levels)}}</span> <span class="caret"></span>
411 <ul class="dropdown-menu">
412 <li class="checkbox">
413 <label ng-click="toggleLevels(true)">
414 <input type="checkbox" class="invisible" />
418 <li class="checkbox">
419 <label ng-click="toggleLevels(false)">
420 <input type="checkbox" class="invisible" />
424 <li role="separator" class="divider"></li>
425 <li class="checkbox" ng-repeat="(level, enabled) in levels">
426 <label class="text-capitalize">
427 <input type="checkbox" ng-model="levels[level]" />
433 <div class="btn-group" filter-dropdown>
434 <button type="button" class="btn btn-default dropdown-toggle">
435 Lint groups <span class="badge">{{selectedValuesCount(groups)}}</span> <span class="caret"></span>
437 <ul class="dropdown-menu">
438 <li class="checkbox">
439 <label ng-click="toggleGroups(true)">
440 <input type="checkbox" class="invisible" />
444 <li class="checkbox">
445 <label ng-click="toggleGroups(false)">
446 <input type="checkbox" class="invisible" />
450 <li role="separator" class="divider"></li>
451 <li class="checkbox" ng-repeat="(group, enabled) in groups">
452 <label class="text-capitalize">
453 <input type="checkbox" ng-model="groups[group]" />
459 <div id="version-filter">
460 <div class="btn-group" filter-dropdown>
461 <button type="button" class="btn btn-default dropdown-toggle">
463 <span id="version-filter-count" class="badge">
464 {{versionFilterCount(versionFilters)}}
466 <span class="caret"></span>
468 <ul id="version-filter-selector" class="dropdown-menu">
469 <li class="checkbox">
470 <label ng-click="clearVersionFilters()">
471 <input type="checkbox" class="invisible" />
475 <li role="separator" class="divider"></li>
476 <li class="checkbox" ng-repeat="(filter, vars) in versionFilters">
477 <label ng-attr-for="filter-{filter}">{{filter}}</label>
481 ng-attr-id="filter-{filter}"
482 class="version-filter-input form-control filter-input"
484 ng-model="versionFilters[filter].minorVersion"
485 ng-model-options="{debounce: 50}"
486 ng-change="updateVersionFilters()" />
494 <div class="col-12 col-md-7 search-control">
495 <div class="input-group">
496 <label class="input-group-addon" id="filter-label" for="search-input">Filter:</label>
497 <input type="text" class="form-control filter-input" placeholder="Keywords or search string" id="search-input" ng-model="search" ng-model-options="{debounce: 50}"/>
498 <span class="input-group-btn">
499 <button class="filter-clear btn" type="button" ng-click="search = ''">
507 <!-- The order of the filters should be from most likely to remove a lint to least likely to improve performance. -->
508 <article class="panel panel-default" id="{{lint.id}}" ng-repeat="lint in data | filter:bySearch | filter:byGroups | filter:byLevels | filter:byVersion">
509 <header class="panel-heading" ng-click="open[lint.id] = !open[lint.id]">
510 <h2 class="panel-title">
511 <div class="panel-title-name">
512 <span>{{lint.id}}</span>
513 <a href="#{{lint.id}}" class="anchor label label-default" ng-click="open[lint.id] = true; $event.stopPropagation()">¶</a>
514 <a href="" id="clipboard-{{lint.id}}" class="anchor label label-default" ng-click="copyToClipboard(lint); $event.stopPropagation()">
519 <div class="panel-title-addons">
520 <span class="label label-lint-group label-default label-group-{{lint.group}}">{{lint.group}}</span>
522 <span class="label label-lint-level label-lint-level-{{lint.level}}">{{lint.level}}</span>
525 <span class="label label-doc-folding" ng-show="open[lint.id]">−</span>
526 <span class="label label-doc-folding" ng-hide="open[lint.id]">+</span>
531 <div class="list-group lint-docs" ng-if="open[lint.id]" ng-class="{collapse: true, in: open[lint.id]}">
532 <div class="list-group-item lint-doc-md" ng-bind-html="lint.docs | markdown"></div>
533 <div class="lint-additional-info-container">
534 <!-- Applicability -->
535 <div class="lint-additional-info-item">
536 <span> Applicability: </span>
537 <span class="label label-default label-applicability">{{lint.applicability.applicability}}</span>
538 <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint_defs/enum.Applicability.html#variants">(?)</a>
540 <!-- Clippy version -->
541 <div class="lint-additional-info-item">
542 <span>{{lint.group == "deprecated" ? "Deprecated" : "Added"}} in: </span>
543 <span class="label label-default label-version">{{lint.version}}</span>
545 <!-- Open related issues -->
546 <div class="lint-additional-info-item">
547 <a href="https://github.com/rust-lang/rust-clippy/issues?q=is%3Aissue+{{lint.id}}">Related Issues</a>
549 <!-- Jump to source -->
550 <div class="lint-additional-info-item">
551 <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>
559 <a href="https://github.com/rust-lang/rust-clippy">
560 <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"/>
563 <script src="https://cdnjs.cloudflare.com/ajax/libs/markdown-it/12.3.2/markdown-it.min.js"></script>
564 <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.5.0/highlight.min.js"></script>
565 <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.5.0/languages/rust.min.js"></script>
566 <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.12/angular.min.js"></script>
567 <script src="script.js"></script>