1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# SPDX-FileCopyrightText: COMPLY contributors
#
# SPDX-License-Identifier: MIT OR Apache-2.0
# The one place a built-in comment style is defined: its delimiters and what
# maps to it. `kind` says which form to emit -- "line" repeats `open` on every
# line; "block" brackets the header with `open`/`close` and leads each inner
# line with `line`; "none" means no comment syntax exists, so a `.license`
# companion is written instead. Naming it removes the old inference of "block"
# from a non-empty `close`, which could not say a style meant both forms.
[]
= "line"
= "//"
# `mts`/`cts` are the one deliberate step past the reference tool, which
# rejects both: refusing to annotate a TypeScript file because of its module
# suffix is a gap in that tool, not a rule of the specification.
= [
"rs",
"c",
"cpp",
"h",
"hpp",
"java",
"kt",
"kts",
"js",
"jsx",
"mjs",
"cjs",
"ts",
"tsx",
"mts",
"cts",
"go",
"swift",
"scala",
"zig",
"dart",
"cs",
"cc",
"cxx",
"hxx",
"php",
"proto",
"gradle",
"groovy",
]
= ["Jenkinsfile"]
[]
= [
"py",
"sh",
"bash",
"zsh",
"fish",
"yaml",
"yml",
"toml",
"cfg",
"ini",
"conf",
"rb",
"pl",
"pm",
"r",
"tf",
"tfvars",
"hcl",
"ps1",
"psm1",
"psd1",
"ex",
"exs",
"nim",
"jl",
"nix",
"cmake",
"bzl",
"dockerfile",
"makefile",
]
= [
"Dockerfile",
"Containerfile",
"Makefile",
"GNUmakefile",
"Gemfile",
"Rakefile",
"Vagrantfile",
"Brewfile",
"Podfile",
"CODEOWNERS",
"CMakeLists.txt",
".gitignore",
".gitattributes",
".gitmodules",
".dockerignore",
".editorconfig",
".yamllint",
".bashrc",
".zshrc",
".profile",
".bash_profile",
]
= "line"
= "#"
[]
= ["sql", "ada", "lua", "hs", "lhs", "cabal", "elm"]
= "line"
= "--"
[]
= "line"
# `;;;` is the Lisp-family convention for a file-level comment, and is what
# the reference tool emits -- not the single `;` the name suggests.
= ["lisp", "clj", "cljs", "cljc", "edn", "scm", "rkt", "el", "asm"]
= ";;;"
[]
= "line"
= "%"
# `m` is MATLAB here rather than Objective-C, which is the call the reference
# tool makes; a project that means the other one says so in its manifest.
= ["tex", "sty", "cls", "erl", "hrl", "m"]
[]
= "*)"
= ["ml", "mli", "pas", "pp"]
= "block"
= " * "
= "(*"
[]
= "*/"
= ["css", "scss", "sass", "less"]
= "block"
= " * "
= "/*"
[]
= ["rst"]
= "line"
= ".."
[]
= ["f90", "f95", "f03", "f08"]
= "line"
= "!"
[]
# `.cmd` is the same deliberate superset as `.mts`/`.cts` on `slash`: reuse
# recognises `.bat` but not `.cmd`, and refusing a file whose interpreter
# treats the two identically is a gap in that tool, not the specification.
= ["bat", "cmd"]
= "line"
= "REM"
[]
= "-->"
= "block"
= ""
= "<!--"
# Markdown belongs here: the reference tool wraps its headers in `<!-- -->`
# too, and a `#` prefix would render as a heading.
= [
"html",
"htm",
"xml",
"xhtml",
"md",
"markdown",
"vue",
"svelte",
"xsl",
"xslt",
]
[]
# `svg` belongs here rather than in `html`, even though SVG does support an XML
# comment: `file/classify.rs` calls it `FileType::Binary`, and a style saying
# otherwise sends it to the inline writer, which prepends at byte 0 -- above the
# `<?xml ...?>` declaration, where XML allows nothing. reuse 6.2.0 agrees.
= [
"svg",
"png",
"jpg",
"jpeg",
"gif",
"ico",
"pdf",
"zip",
"tar",
"gz",
"o",
"so",
"dll",
"exe",
"bin",
"class",
"jar",
"ttf",
"otf",
"woff",
"woff2",
]
= "none"