Skip to content

Escape column comment newlines when using "rightmost" value for position_of_column_comment option#263

Merged
drwl merged 2 commits intodrwl:mainfrom
rowanhogan:escape-rightmost-column-comment-newlines
Sep 20, 2025
Merged

Escape column comment newlines when using "rightmost" value for position_of_column_comment option#263
drwl merged 2 commits intodrwl:mainfrom
rowanhogan:escape-rightmost-column-comment-newlines

Conversation

@rowanhogan
Copy link
Contributor

This is a follow-up to the changes added in #199.

We noticed that when using the rightmost option for column comment position, any multi-line column comments were not being escaped in the same manner as the with_name option. This causes problems with generated model annotation as invalid uncommented newlines then appear. For example:

Before

#  notes                                        :text(55)         not null     Notes.
May include things like notes.

After

#  notes                                        :text(55)         not null     Notes\nMay include things like notes.

I have also updated the documentation for this option to include the available values – I had to dig through the codebase to find the possible values for the --position-of-column-comments option.

Thanks for this great gem, my company uses it in our projects 👏

…ion_of_column_comment option

This follows the method used for the "with_name" value.
Test coverage newlines in comments has been added for markdown formatting as well.
Copy link
Owner

@drwl drwl left a comment

Choose a reason for hiding this comment

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

Thanks for the bug fix and the kind note. Also thank you for improving test coverage 👍

@drwl drwl merged commit 7332f26 into drwl:main Sep 20, 2025
22 checks passed
@rowanhogan rowanhogan deleted the escape-rightmost-column-comment-newlines branch September 29, 2025 01:34
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