From dc4f2db4cfcf685fa58a8dac89e7f9eb6b036f1c Mon Sep 17 00:00:00 2001 From: Nate Biggs Date: Thu, 4 Jun 2026 12:06:58 -0700 Subject: [PATCH] [agents] Add rule to enforce license header on new Dart files Enforces the inclusion of the standard copyright and BSD-style license header with the current year at the top of newly created Dart files. TAG=agy CONV=03fa0bca-5bc4-4526-8592-707d62f64410 Change-Id: I0b4a085e3f2d69a3459dee84336f0be36499e4cb Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/509440 Reviewed-by: Kevin Moore Commit-Queue: Nate Biggs --- .agents/rules/add_license_header.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .agents/rules/add_license_header.md diff --git a/.agents/rules/add_license_header.md b/.agents/rules/add_license_header.md new file mode 100644 index 00000000000..2c5d407744f --- /dev/null +++ b/.agents/rules/add_license_header.md @@ -0,0 +1,21 @@ +--- +trigger: glob +description: Ensure standard Dart license header on newly created Dart files. +globs: *.dart +--- + +# License Header Rule + +Whenever you create a new Dart (`.dart`) file in this repository, you MUST include the standard Dart project license header at the very top (line 1). + +Replace `` with the actual current year (e.g., 2026). + +```dart +// Copyright (c) , the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. +``` + +## Requirements +- Insert at line 1. +- Ensure a blank line follows the license header before any other code or comments.