Files
sdk/.agents/rules/add_license_header.md
Nate Biggs dc4f2db4cf [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 <kevmoo@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2026-06-04 12:06:58 -07:00

22 lines
717 B
Markdown

---
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 `<CURRENT_YEAR>` with the actual current year (e.g., 2026).
```dart
// Copyright (c) <CURRENT_YEAR>, 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.