|
1 |
| -{ // Summary: markdownlint config file for Cirq -*- jsonc -*- |
| 1 | +{ // -*- jsonc -*- |
| 2 | + // Copyright 2025 The Cirq Developers |
2 | 3 | //
|
3 |
| - // Note: there are multiple programs programs named "markdownlint". For |
4 |
| - // Cirq, we use https://github.com/igorshubovych/markdownlint-cli/, which is |
5 |
| - // the one you get with "brew install markdownlint" on MacOS. |
| 4 | + // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + // you may not use this file except in compliance with the License. |
| 6 | + // You may obtain a copy of the License at |
| 7 | + // |
| 8 | + // https://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + // |
| 10 | + // Unless required by applicable law or agreed to in writing, software |
| 11 | + // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + // See the License for the specific language governing permissions and |
| 14 | + // limitations under the License. |
| 15 | + |
| 16 | + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 17 | + // Markdownlint linter configuration for this project. |
| 18 | + // |
| 19 | + // Note: there are multiple programs programs named "markdownlint". We use |
| 20 | + // https://github.com/igorshubovych/markdownlint-cli/, which is the one you |
| 21 | + // get with "brew install markdownlint" on MacOS. |
6 | 22 | //
|
7 | 23 | // These settings try to stay close to the Google Markdown Style as
|
8 | 24 | // described at https://google.github.io/styleguide/docguide/style.html
|
| 25 | + // with very few differences. |
9 | 26 | //
|
10 | 27 | // For a list of configuration options, see the following page:
|
11 | 28 | // https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md
|
|
41 | 58 | "br_spaces": 0
|
42 | 59 | },
|
43 | 60 |
|
44 |
| - // Google style exempts some constructs from the line-length limit of 80 chars. |
| 61 | + // Google style is 80 characters. |
| 62 | + // Google style exempts some constructs from the line-length limit: |
45 | 63 | // https://google.github.io/styleguide/docguide/style.html#exceptions
|
46 | 64 | "line-length": {
|
| 65 | + "line_length": 100, |
| 66 | + "code_block_line_length": 100, |
| 67 | + "heading_line_length": 100, |
47 | 68 | "code_blocks": false,
|
48 | 69 | "headings": false,
|
49 | 70 | "tables": false
|
|
67 | 88 | "no-bare-urls": false,
|
68 | 89 |
|
69 | 90 | // Basic Markdown allows raw HTML. Both GitHub & PyPI support subsets of
|
70 |
| - // HTML, though it's unclear what subset PyPI supports. Google's style |
71 |
| - // guide doesn't disallow using HTML, although it recommends against it. (C.f. |
72 |
| - // the bottom of https://google.github.io/styleguide/docguide/style.html) |
73 |
| - // It's worth noting, though, that Google's guidance has Google's internal |
74 |
| - // documentation system in mind, and that system extends Markdown with |
75 |
| - // constructs that make it possible to accomplish things you can't do in |
76 |
| - // Markdown. Those extensions are also not available outside Google's system. |
77 |
| - // Thus, although a goal of this markdownlint configuration is to match |
78 |
| - // Google's style guide as closely as possible, these various factors suggest |
79 |
| - // it's reasonable to relax the HTML limitation. The list below is based on |
80 |
| - // https://github.com/github/markup/issues/245#issuecomment-682231577 plus |
81 |
| - // some things found elsewhere after that was written. |
| 91 | + // HTML, though it's unclear what subset PyPI supports. Google's style guide |
| 92 | + // recommends against using raw HTML, but does allow it. (C.f. the bottom of |
| 93 | + // https://google.github.io/styleguide/docguide/style.html) Google's in-house |
| 94 | + // documentation system allows many inline and block-level tags, but strips |
| 95 | + // others that can pose security risks (e.g., <object> and standalone <svg>). |
| 96 | + // The list below tries to capture the intersection of what GitHub allows |
| 97 | + // (c.f. https://github.com/github/markup/issues/245#issuecomment-682231577), |
| 98 | + // what PyPI seems to allow, what Google allows, and what seems likely to be |
| 99 | + // most useful in situations where someone needs to reach for HTML. |
82 | 100 | "html": {
|
83 | 101 | "allowed_elements": [
|
84 | 102 | "a",
|
85 | 103 | "abbr",
|
86 | 104 | "b",
|
87 |
| - "bdo", |
88 | 105 | "blockquote",
|
89 | 106 | "br",
|
90 | 107 | "caption",
|
|
106 | 123 | "h4",
|
107 | 124 | "h5",
|
108 | 125 | "h6",
|
109 |
| - "h7", |
110 |
| - "h8", |
111 | 126 | "hr",
|
112 | 127 | "i",
|
113 | 128 | "img",
|
|
120 | 135 | "picture",
|
121 | 136 | "pre",
|
122 | 137 | "q",
|
123 |
| - "rp", |
124 |
| - "rt", |
125 |
| - "ruby", |
126 | 138 | "s",
|
127 | 139 | "samp",
|
128 | 140 | "small",
|
129 |
| - "source", |
130 |
| - "span", |
131 | 141 | "span",
|
132 |
| - "strike", |
133 | 142 | "strong",
|
134 | 143 | "sub",
|
135 | 144 | "summary",
|
|
145 | 154 | "tt",
|
146 | 155 | "ul",
|
147 | 156 | "var",
|
148 |
| - "video", |
149 | 157 | "wbr"
|
150 | 158 | ]
|
151 | 159 | }
|
|
0 commit comments