Skip to content

Conversation

@jackrosenthal
Copy link

Summary

This adds a comment containing the @generated marker to the top of
all uv.lock files. The @generated marker is a widely-adopted
convention (see https://generated.at/) that helps tools (like IDEs,
code formatters, and code review tools) identify files as generated
and handle them appropriately.

Other common tools use this marker in lock files as well (such as Cargo
and Poetry).

Fixes #13878.

Test Plan

  • Unit tests
  • Observe marker in output of uv lock

This adds a comment containing the `@generated` marker to the top of
all `uv.lock` files.  The `@generated` marker is a widely-adopted
convention (see https://generated.at/) that helps tools (like IDEs,
code formatters, and code review tools) identify files as generated
and handle them appropriately.

Other common tools use this marker in lock files as well (such as Cargo
and Poetry).

Fixes astral-sh#13878.
@zanieb
Copy link
Member

zanieb commented Oct 16, 2025

I don't think we have reached consensus that this should be done.

@zanieb zanieb added the needs-decision Undecided if this should be done label Oct 16, 2025

let content = doc.to_string();
Ok(format!(
"# This file was @generated by uv. Do not edit by hand.\n{content}"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use a single space after the period? Basically every single style guide on earth recommends a single space (even when using a monospace font).
e.g. see https://cmosshoptalk.com/2020/03/24/one-space-or-two/ or https://apastyle.apa.org/style-grammar-guidelines/paper-format/accessibility/typography#myth4

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

Labels

needs-decision Undecided if this should be done

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a comment to the top of uv.lock files containing the string @generated

3 participants