]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/util/gh-pages/index.html
6183089911bdc0d35c0e5845b7a941da8129c185
[rust.git] / src / tools / clippy / util / gh-pages / index.html
1 <!DOCTYPE html>
2 <!--
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.
6
7 Otherwise, have a great day =^.^=
8 -->
9 <html lang="en">
10 <head>
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.">
14
15     <title>Clippy Lints</title>
16
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"/>
19
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">
25     <style>
26         blockquote { font-size: 1em; }
27         [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak { display: none !important; }
28
29         .dropdown-menu {
30             color: var(--fg);
31             background: var(--theme-popup-bg);
32             border: 1px solid var(--theme-popup-border);
33         }
34
35         .dropdown-menu .divider {
36             background-color: var(--theme-popup-border);
37         }
38
39         .dropdown-menu .checkbox {
40             display: block;
41             white-space: nowrap;
42             margin: 0;
43         }
44         .dropdown-menu .checkbox label {
45             padding: 3px 20px;
46             width: 100%;
47         }
48
49         .dropdown-menu .checkbox input {
50             position: relative;
51             margin: 0 0.5rem 0;
52             padding: 0;
53         }
54
55         .dropdown-menu .checkbox:hover {
56             background-color: var(--theme-hover);
57         }
58
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);
63         }
64
65         div.panel div.panel-body button.dropdown-toggle:hover {
66             box-shadow: 0 0 3px var(--searchbar-shadow-color);
67         }
68
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%);
74         }
75
76         .dropdown-toggle .badge {
77             background-color: #777;
78         }
79
80         .panel-heading { cursor: pointer; }
81
82         .panel-title { display: flex; flex-wrap: wrap;}
83         .panel-title .label { display: inline-block; }
84
85         .panel-title-name { flex: 1; min-width: 400px;}
86         .panel-title-name span { vertical-align: bottom; }
87
88         .panel .panel-title-name .anchor { display: none; }
89         .panel:hover .panel-title-name .anchor { display: inline;}
90
91         .search-control {
92             margin-top: 15px;
93         }
94
95         @media (min-width: 992px) {
96             .search-control {
97                 margin-top: 0;
98                 float: right;
99             }
100         }
101
102         @media (min-width: 405px) {
103             #upper-filters {
104                 display: flex;
105             }
106         }
107
108         @media (max-width: 430px) {
109             /* Turn the version filter list to the left */
110             #version-filter-selector {
111                 right: 0;
112                 left: auto;
113             }
114         }
115
116         @media (max-width: 412px) {
117             #upper-filters,
118             .panel-body .search-control  {
119                 padding-right: 8px;
120                 padding-left: 8px;
121             }
122         }
123
124         .label {
125             padding-top: 0.3em;
126             padding-bottom: 0.3em;
127         }
128
129         .label-lint-group {
130             min-width: 8em;
131         }
132         .label-lint-level {
133             min-width: 4em;
134         }
135
136         .label-lint-level-allow {
137             background-color: #5cb85c;
138         }
139         .label-lint-level-warn {
140             background-color: #f0ad4e;
141         }
142         .label-lint-level-deny {
143             background-color: #d9534f;
144         }
145         .label-lint-level-none {
146             background-color: #777777;
147             opacity: 0.5;
148         }
149
150         .label-group-deprecated {
151             opacity: 0.5;
152         }
153
154         .label-doc-folding {
155             color: #000;
156             background-color: #fff;
157             border: 1px solid var(--theme-popup-border);
158         }
159         .label-doc-folding:hover {
160             background-color: #e6e6e6;
161         }
162
163         .lint-doc-md > h3 {
164             border-top: 1px solid var(--theme-popup-border);
165             padding: 10px 15px;
166             margin: 0 -15px;
167             font-size: 18px;
168         }
169         .lint-doc-md > h3:first-child {
170             border-top: none;
171             padding-top: 0px;
172         }
173
174         @media (max-width:749px) {
175             .lint-additional-info-container {
176                 display: flex;
177                 flex-flow: column;
178             }
179             .lint-additional-info-item + .lint-additional-info-item {
180                 border-top: 1px solid var(--theme-popup-border);
181             }
182         }
183         @media (min-width:750px) {
184             .lint-additional-info-container {
185                 display: flex;
186                 flex-flow: row;
187             }
188             .lint-additional-info-item + .lint-additional-info-item {
189                 border-left: 1px solid var(--theme-popup-border);
190             }
191         }
192
193         .lint-additional-info-item {
194             display: inline-flex;
195             min-width: 200px;
196             flex-grow: 1;
197             padding: 9px 5px 5px 15px;
198         }
199
200         .label-applicability {
201             background-color: #777777;
202             margin: auto 5px;
203         }
204
205         .label-version {
206             background-color: #777777;
207             margin: auto 5px;
208             font-family: monospace;
209         }
210
211         details {
212             border-radius: 4px;
213             padding: .5em .5em 0;
214         }
215
216         code {
217             white-space: pre !important;
218         }
219
220         summary {
221             font-weight: bold;
222             margin: -.5em -.5em 0;
223             padding: .5em;
224             display: revert;
225         }
226
227         details[open] {
228             padding: .5em;
229         }
230     </style>
231     <style>
232         /* Expanding the mdBoom theme*/
233         .light {
234             --inline-code-bg: #f6f7f6;
235         }
236         .rust {
237             --inline-code-bg: #f6f7f6;
238         }
239         .coal {
240             --inline-code-bg: #1d1f21;
241         }
242         .navy {
243             --inline-code-bg: #1d1f21;
244         }
245         .ayu {
246             --inline-code-bg: #191f26;
247         }
248
249         .theme-dropdown {
250             position: absolute;
251             margin: 0.7em;
252             z-index: 10;
253         }
254
255         /* Applying the mdBook theme */
256         .theme-icon {
257             text-align: center;
258             width: 2em;
259             height: 2em;
260             line-height: 2em;
261             border: solid 1px var(--icons);
262             border-radius: 5px;
263             user-select: none;
264             cursor: pointer;
265         }
266         .theme-icon:hover {
267             background: var(--theme-hover);
268         }
269         .theme-choice {
270             display: none;
271             list-style: none;
272             border: 1px solid var(--theme-popup-border);
273             border-radius: 5px;
274             color: var(--fg);
275             background: var(--theme-popup-bg);
276             padding: 0 0;
277             overflow: hidden;
278         }
279
280         .theme-dropdown.open .theme-choice {
281             display: block;
282         }
283
284         .theme-choice > li {
285             padding: 5px 10px;
286             font-size: 0.8em;
287             user-select: none;
288             cursor: pointer;
289         }
290
291         .theme-choice > li:hover {
292             background: var(--theme-hover);
293         }
294
295         .alert {
296             color: var(--fg);
297             background: var(--theme-hover);
298             border: 1px solid var(--theme-popup-border);
299         }
300         .page-header {
301             border-color: var(--theme-popup-border);
302         }
303         .panel-default > .panel-heading {
304             background: var(--theme-hover);
305             color: var(--fg);
306             border: 1px solid var(--theme-popup-border);
307         }
308         .panel-default > .panel-heading:hover {
309             filter: brightness(90%);
310         }
311         .list-group-item {
312             background: 0%;
313             border: 1px solid var(--theme-popup-border);
314         }
315         .panel, pre, hr {
316             background: var(--bg);
317             border: 1px solid var(--theme-popup-border);
318         }
319
320         #version-filter-selector .checkbox {
321             display: flex;
322         }
323
324         #version-filter {
325             min-width: available;
326         }
327
328         #version-filter li label {
329             padding-right: 0;
330             width: 35%;
331         }
332
333         .version-filter-input {
334             height: 60%;
335             width: 30%;
336             text-align: center;
337             border: none;
338             border-bottom: 1px solid #000000;
339         }
340
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%);
346         }
347         #filter-label:hover, .filter-clear:hover {
348             filter: brightness(90%);
349         }
350         .filter-input {
351             background: var(--searchbar-bg);
352             color: var(--searchbar-fg);
353             border-color: var(--theme-popup-border);
354         }
355
356         .filter-input::-webkit-input-placeholder,
357         .filter-input::-moz-placeholder {
358             color: var(--searchbar-fg);
359             opacity: 30%;
360         }
361
362         :not(pre) > code {
363             color: var(--inline-code-color);
364             background-color: var(--inline-code-bg);
365         }
366         html {
367             scrollbar-color: var(--scrollbar) var(--bg);
368         }
369         body {
370             background: var(--bg);
371             color: var(--fg);
372         }
373
374     </style>
375 </head>
376 <body ng-app="clippy" ng-controller="lintList">
377     <div theme-dropdown class="theme-dropdown">
378         <div id="theme-icon" class="theme-icon">&#128396;</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>
381         </ul>
382     </div>
383
384     <div class="container">
385         <div class="page-header">
386             <h1>Clippy Lints</h1>
387         </div>
388
389         <noscript>
390             <div class="alert alert-danger" role="alert">
391                 Sorry, this site only works with JavaScript! :(
392             </div>
393         </noscript>
394
395         <div ng-cloak>
396
397             <div class="alert alert-info" role="alert" ng-if="loading">
398                 Loading&#x2026;
399             </div>
400             <div class="alert alert-danger" role="alert" ng-if="error">
401                 Error loading lints!
402             </div>
403
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>
410                             </button>
411                             <ul class="dropdown-menu">
412                                 <li class="checkbox">
413                                     <label ng-click="toggleLevels(true)">
414                                         <input type="checkbox" class="invisible" />
415                                         All
416                                     </label>
417                                 </li>
418                                 <li class="checkbox">
419                                     <label ng-click="toggleLevels(false)">
420                                         <input type="checkbox" class="invisible" />
421                                         None
422                                     </label>
423                                 </li>
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]" />
428                                         {{level}}
429                                     </label>
430                                 </li>
431                             </ul>
432                         </div>
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>
436                             </button>
437                             <ul class="dropdown-menu">
438                                 <li class="checkbox">
439                                     <label ng-click="toggleGroups(true)">
440                                         <input type="checkbox" class="invisible" />
441                                         All
442                                     </label>
443                                 </li>
444                                 <li class="checkbox">
445                                     <label ng-click="toggleGroups(false)">
446                                         <input type="checkbox" class="invisible" />
447                                         None
448                                     </label>
449                                 </li>
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]" />
454                                         {{group}}
455                                     </label>
456                                 </li>
457                             </ul>
458                         </div>
459                         <div id="version-filter">
460                             <div class="btn-group" filter-dropdown>
461                                 <button type="button" class="btn btn-default dropdown-toggle">
462                                     Version
463                                     <span id="version-filter-count" class="badge">
464                                         {{versionFilterCount(versionFilters)}}
465                                     </span>
466                                     <span class="caret"></span>
467                                 </button>
468                                 <ul id="version-filter-selector" class="dropdown-menu">
469                                     <li class="checkbox">
470                                         <label ng-click="clearVersionFilters()">
471                                             <input type="checkbox" class="invisible" />
472                                             Clear filters
473                                         </label>
474                                     </li>
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>
478                                         <span>1.</span>
479                                         <input type="number"
480                                                 min="29"
481                                                 ng-attr-id="filter-{filter}"
482                                                 class="version-filter-input form-control filter-input"
483                                                 maxlength="2"
484                                                 ng-model="versionFilters[filter].minorVersion"
485                                                 ng-model-options="{debounce: 50}"
486                                                 ng-change="updateVersionFilters()" />
487                                         <span>.0</span>
488                                     </li>
489                                 </ul>
490                             </div>
491                         </div>
492
493                     </div>
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 = ''">
500                                     Clear
501                                 </button>
502                             </span>
503                         </div>
504                     </div>
505                 </div>
506             </div>
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()">&para;</a>
514                             <a href="" id="clipboard-{{lint.id}}" class="anchor label label-default" ng-click="copyToClipboard(lint); $event.stopPropagation()">
515                                 &#128203;
516                             </a>
517                         </div>
518
519                         <div class="panel-title-addons">
520                             <span class="label label-lint-group label-default label-group-{{lint.group}}">{{lint.group}}</span>
521
522                             <span class="label label-lint-level label-lint-level-{{lint.level}}">{{lint.level}}</span>
523
524
525                             <span class="label label-doc-folding" ng-show="open[lint.id]">&minus;</span>
526                             <span class="label label-doc-folding" ng-hide="open[lint.id]">&plus;</span>
527                         </div>
528                     </h2>
529                 </header>
530
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>
539                         </div>
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>
544                         </div>
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>
548                         </div>
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>
552                         </div>
553                     </div>
554                 </div>
555             </article>
556         </div>
557     </div>
558
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"/>
561     </a>
562
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>
568 </body>
569 </html>