Skip to content

[infra] Add license checker to ci script#3114

Open
dcharkes wants to merge 1 commit intomainfrom
infra-licence-checker
Open

[infra] Add license checker to ci script#3114
dcharkes wants to merge 1 commit intomainfrom
infra-licence-checker

Conversation

@dcharkes
Copy link
Collaborator

This enables running (and fixing automatically) locally.

The ecosystem check is skipping build directories: https://github.com/dart-lang/ecosystem/blob/main/pkgs/firehose/lib/src/health/license.dart This caused the CI to miss: #3113

Also, we should add license checks to non-dart files (follow up PR).

So, lets run this on the CI here on GitHub as well.

@dcharkes dcharkes requested a review from goderbauer February 17, 2026 08:25
Base automatically changed from hooks-runner-missing-license-header to main February 17, 2026 08:37
@goderbauer
Copy link
Contributor

So why is the license header check that we have on github not enough to catch this and we need to implement our own thing?

@goderbauer
Copy link
Contributor

Also, Windows is unhappy.

@dcharkes dcharkes force-pushed the infra-licence-checker branch from f7009df to ddc08a6 Compare February 17, 2026 09:19
@dcharkes
Copy link
Collaborator Author

So why is the license header check that we have on github not enough to catch this and we need to implement our own thing?

I can't run that check locally. I can't tell contributors to run that check locally. It doesn't work in any build/ dirs. And it can only do Dart files (which this PR doesn't fix yet).

If you have any ideas on how to un github-i-fy the dart-lang/ecosystem checks so we can run them easily with a script locally, I'd be happy for that as an alternative.

@goderbauer
Copy link
Contributor

Okay, but why didn't that check catch the missing license headers? Is it broken? Are we running the license checker now twice on CI (this one and the one from the github actions) with different sources of truth of what the license should look like?

@github-actions
Copy link

PR Health

Breaking changes ✔️
Package Change Current Version New Version Needed Version Looking good?
hooks None 1.0.1 1.0.2-wip 1.0.2-wip ✔️

This check can be disabled by tagging the PR with skip-breaking-check.

Changelog Entry ✔️
Package Changed Files

Changes to files need to be accounted for in their respective changelogs.

This check can be disabled by tagging the PR with skip-changelog-check.

License Headers ✔️
// Copyright (c) 2026, 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.
Files
no missing headers

All source files should start with a license header.

Unrelated files missing license headers
Files
pkgs/jni/test/debug_release_test.dart
pkgs/objective_c/example/command_line/lib/main.dart
pkgs/objective_c/lib/src/ns_input_stream.dart

This check can be disabled by tagging the PR with skip-license-check.

API leaks ✔️

The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.

Package Leaked API symbol Leaking sources

This check can be disabled by tagging the PR with skip-leaking-check.

@dcharkes
Copy link
Collaborator Author

Okay, but why didn't that check catch the missing license headers? Is it broken?

I believe it blanket ignores build/ directories. Glancing at the source code it only supports glob, so it cannot ignore only Flutter build directories.

Are we running the license checker now twice on CI (this one and the one from the github actions) with different sources of truth of what the license should look like?

Should we disable the ecosystem one? As I will add non-Dart license header checks to this one.

@coveralls
Copy link

coveralls commented Feb 17, 2026

Coverage Status

coverage: 78.178%. remained the same
when pulling f146809 on infra-licence-checker
into 938b861 on main.

@dcharkes dcharkes force-pushed the infra-licence-checker branch from b3015fd to f146809 Compare February 17, 2026 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants