用途:在创建新文件或需要校验版权头时,按文件扩展名插入对应的版权头声明。
主要能力与格式: Dart(.dart)与 Shell(.sh)使用 // 或 # 注释: // Copyright 20?? The Flutter Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file or at https://developers.google.com/open-source/licenses/bsd. YAML(.yaml)与 Shell 相同用 # 前缀。HTML(.html)和 Markdown(.md)使用 HTML 注释包裹。Shell 脚本示例: #!/bin/bash
Copyright 2026 The Flutter Authors
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file or at https://developers.google.com/open-source/licenses/bsd.
使用方式:新建文件时必须按扩展名添加,将 20?? 替换为当前年份(如 2026)。默认放在文件最顶部;若文件需要 shebang(如 #!/bin/bash)或其他 frontmatter,则版权头放在其后,并用空行分隔。
限制与排除:以点号开头的目录(如 .agents/、.gemini/、.github/)无需添加。编辑已有文件时不要修改版权头中的年份,后续编辑同样保持年份不变。