Skip to content

Place column comments at the end of the line#199

Merged
drwl merged 18 commits intodrwl:mainfrom
Adeynack:feature/164-place-column-comments-at-the-end-of-the-line
Jul 1, 2025
Merged

Place column comments at the end of the line#199
drwl merged 18 commits intodrwl:mainfrom
Adeynack:feature/164-place-column-comments-at-the-end-of-the-line

Conversation

@Adeynack
Copy link
Contributor

@Adeynack Adeynack commented Mar 3, 2025

Fixes #164

Adds the configuration position_of_column_comment, now defaults to with_name (already existing behavior), and can also be set to rightmost_column.

There was a bit of moving code around involved, as some information about other attribute was needed (e.g.: the attributes of other columns, to determine how wide this column must be).

The only formats where it got implemented though are:

  • default (text)
  • Markdown

The other formats I do not know well, and would ask anyone with better knowledge of them to work on it.

@Adeynack
Copy link
Contributor Author

Adeynack commented Apr 7, 2025

Either the lint rules changed, or what was merged into this branch is not properly formatted. I will fix this this week.

@Adeynack
Copy link
Contributor Author

Adeynack commented Jun 8, 2025

@drwl : The checks seem fine again.

@Adeynack
Copy link
Contributor Author

@drwl : Seems you need to approve the PR again for the CI workflows to be started 🤔 If I understand what I read from GitHub properly.

@Adeynack
Copy link
Contributor Author

Adeynack commented Jun 24, 2025

@drwl : Thanks for the maintenance on this. 👌🏼 Did not have time to tackle it in the last few weeks (the lint issues).

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 taking the time and adding this as well as updating the test coverage!

@drwl drwl merged commit d264281 into drwl:main Jul 1, 2025
22 checks passed
@Adeynack Adeynack deleted the feature/164-place-column-comments-at-the-end-of-the-line branch July 1, 2025 07:48
@drwl
Copy link
Owner

drwl commented Jul 14, 2025

I just release v4.17.0 and it contains this change. Let me know if there are any issues.

drwl pushed a commit that referenced this pull request Sep 20, 2025
…ion_of_column_comment option (#263)

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 👏
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.

Place column comments at the end of the line (feature suggestion)

2 participants