pub const HEADER: &str = "// Code generated by oapi-codegen-rust. DO NOT EDIT.\n#![allow(\n dead_code,\n unused_imports,\n clippy::all,\n clippy::pedantic,\n clippy::nursery,\n clippy::restriction,\n reason = \"generated code, not first-party source\"\n)]\n\n";Expand description
Header prepended to every generated file: the do-not-edit marker, then a blanket clippy allowance.
Clippy is the compiler, so a lint level belongs to the module tree and not to a
path. There is no exclude key and no blanket switch: #![allow(clippy)] is an
unknown lint and #![allow(clippy::*)] does not parse. Both measured. The four
groups below hold every clippy lint, including any a later release adds, so this
never tracks a lint list.
dead_code is a rustc lint, so the groups miss it. A generated file offers every
type the specification declares, and a consumer uses the ones it needs.
unused_imports is a rustc lint too, and the split output needs it for the same
reason. The root file re-exports every module so each name stays where it was, and
a module imports every name its file could refer to. Neither depends on the
consumer reaching for all of them.
An inner attribute needs the file to be a module. #[path = "..."] mod x; reads
a generated file, and include! cannot, because rustc rejects an inner attribute
in a paste.