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

If a shebang already exists when adding a preamble, preserve it. #19133

Merged

Conversation

stuhood
Copy link
Sponsor Member

@stuhood stuhood commented May 24, 2023

Currently if a file contains a shebang but no preamble, the premable linter will break the shebang by prepending the preamble.

This change adjusts the regex match to preserve the existing shebang.

@stuhood stuhood added needs-cherrypick category:bugfix Bug fixes for released features labels May 24, 2023
@stuhood stuhood added this to the 2.16.x milestone May 24, 2023
@stuhood stuhood requested a review from thejcannon May 24, 2023 16:49
Copy link
Member

@thejcannon thejcannon left a comment

Choose a reason for hiding this comment

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

LGTM. If you don't mind a bit of a delay, let's wait until #19125 is in before merging this to see if that does indeed fix the auto-cherry-picker

@stuhood stuhood merged commit 2486ba8 into pantsbuild:main May 24, 2023
25 checks passed
@stuhood stuhood deleted the stuhood/preserve-shebang-in-preamble branch May 24, 2023 19:28
github-actions bot pushed a commit that referenced this pull request May 24, 2023
)

Currently if a file contains a shebang but no preamble, the premable
linter will break the shebang by prepending the preamble.

This change adjusts the regex match to preserve the existing shebang.
github-actions bot pushed a commit that referenced this pull request May 24, 2023
)

Currently if a file contains a shebang but no preamble, the premable
linter will break the shebang by prepending the preamble.

This change adjusts the regex match to preserve the existing shebang.
stuhood added a commit that referenced this pull request May 24, 2023
…rry-pick of #19133) (#19138)

Currently if a file contains a shebang but no preamble, the premable
linter will break the shebang by prepending the preamble.

This change adjusts the regex match to preserve the existing shebang.

Co-authored-by: Stu Hood <stuhood@gmail.com>
stuhood added a commit that referenced this pull request May 24, 2023
…rry-pick of #19133) (#19137)

Currently if a file contains a shebang but no preamble, the premable
linter will break the shebang by prepending the preamble.

This change adjusts the regex match to preserve the existing shebang.

Co-authored-by: Stu Hood <stuhood@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:bugfix Bug fixes for released features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants