Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(autofix): preserve trailing newlines in files when applying patches #1419

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

jennmueng
Copy link
Member

Autofix was removing trailing newlines when applying files for pr creation.

The added unit test fails without this change, passes with the change.

@jennmueng jennmueng requested a review from roaga November 11, 2024 21:05
@jennmueng jennmueng requested a review from a team as a code owner November 11, 2024 21:05
Copy link
Member

@roaga roaga left a comment

Choose a reason for hiding this comment

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

This solves the case where we accidentally remove newlines at the end, but does it account for the case where we actually have a diff change that is supposed to remove newlines at the end?

@jennmueng
Copy link
Member Author

@roaga It doesn't, and is a limitation, but I don't see that being a case that autofix would do or be used for.

Because it's expected practice to keep trailing newlines at the end of code files, it should be maintaining that for customer code (when it already exists)

@jennmueng jennmueng merged commit 5562d4f into main Nov 11, 2024
10 of 11 checks passed
@jennmueng jennmueng deleted the jenn/autofix/fix-trailing-newlines branch November 11, 2024 21:33
Copy link

sentry-io bot commented Nov 12, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ IndexError: list index out of range app.autofix_update_endpoint View Issue

Did you find this useful? React with a 👍 or 👎

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