Skip to content

Instantly share code, notes, and snippets.

@ajfriend
Last active March 11, 2026 21:12
Show Gist options
  • Select an option

  • Save ajfriend/8559e505b1368f1aa5e4df25e4a587fc to your computer and use it in GitHub Desktop.

Select an option

Save ajfriend/8559e505b1368f1aa5e4df25e4a587fc to your computer and use it in GitHub Desktop.

Replace verbose license headers with SPDX identifiers

Proposal for uber/h3.

Problem

Every H3 C source file includes a 15-line Apache 2.0 license header with copyright years:

/*
 * Copyright 2016-2021 Uber Technologies, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

This practice has some issues:

  • Requires manual upkeep of year ranges. Even with manual maintenance, many files in the repository have incorrect years.
  • Adds noise for human readers.
  • Wastes tokens when LLMs ingest the codebase: identical 15-line headers repeated across hundreds of files consume context window on zero-information content.

Proposal

Replace the 15-line header with an SPDX identifier and a copyright notice in every file:

// SPDX-License-Identifier: Apache-2.0
// Copyright Uber Technologies, Inc.

Benefits

  • Eliminates header variation across files; no ongoing maintenance
  • Reduces noise in every file
  • Machine-parsable by license compliance tools (e.g., reuse lint)
  • The SPDX specification defines the exact syntax, so there's no ambiguity

Precedent

SPDX identifiers are well-established across major projects and organizations:

Why no year?

The proposed copyright line omits the year intentionally. This keeps the header identical across all files regardless of when they were created or modified.

Both the REUSE specification and the SPDX specification list year-free copyright notices as valid. Several major projects have already dropped years from copyright notices:

The Linux Foundation recommends year-free copyright notices, noting that per-file notices are "rarely kept up to date" and increase burden on developers "without tangible benefit."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment