Skip to content

Conversation

@jackrosenthal
Copy link

Type of changes

  • Bug fix
  • New feature
  • Documentation / docstrings
  • Tests
  • Other - simple change to generated files

AI?

  • AI was used to generate this PR

AI generated PRs may be accepted, but only if @willmcgugan has responded on an issue or discussion.

Checklist

  • I've run the latest black with default args on new code.
  • I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate (see note about typos above).
  • I've added tests for new code.
  • I accept that @willmcgugan may be pedantic in the code review.

Description

The @generated marker is a loose standard used to identify machine-generated files. Tools like GitHub, IDEs, and various linters recognize this marker to automatically collapse generated files, exclude generated code from coverage metrics, and provide visual indicators in pull requests.

This convention has been adopted by many popular tools including Poetry (in poetry.lock), Cargo (in Cargo.lock), protobuf gencode, and more.

This adds the @generated header comment to HTML and SVG files produced by Console.export_html(), Console.export_svg(), Console.save_html(), and Console.save_svg().

The `@generated` marker is a loose standard used to identify
machine-generated files.  Tools like GitHub, IDEs, and various
linters recognize this marker to automatically collapse generated
files, exclude generated code from coverage metrics, and provide
visual indicators in pull requests.

This convention has been adopted by many popular tools including
Poetry (in `poetry.lock`), Cargo (in `Cargo.lock`), protobuf
gencode, and more.

This adds the `@generated` header comment to HTML and SVG files
produced by `Console.export_html()`, `Console.export_svg()`,
`Console.save_html()`, and `Console.save_svg()`.
Copy link
Member

@willmcgugan willmcgugan left a comment

Choose a reason for hiding this comment

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

We use SVGs to take snapshots of TUI apps. This change will make all snapshots break, for the sake of a comment.

It is a good idea, but I'd prefer if you made it optional for now, defaulting to off. In the future I can update the default to on.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants