Skip to content

Do not add whitespace after magic comments when annotating at position after/bottom #584

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

Merged
merged 1 commit into from
Jan 22, 2019
Merged

Do not add whitespace after magic comments when annotating at position after/bottom #584

merged 1 commit into from
Jan 22, 2019

Conversation

tjwp
Copy link
Contributor

@tjwp tjwp commented Nov 9, 2018

When position is set to after or bottom the current behavior added an extra newline following magic comments.

If the file is being annotated at position after/bottom there should be no need to make modifications after the magic comments. (Any style/formatting there is not the concern of this gem if the file is not being annotated there.)

This change fixes that behavior to only insert a newline if the file is being annotated at position before/top, i.e. between the magic comments and existing content.

@ctran ctran added the bug label Jan 22, 2019
@ctran ctran added this to the v.2.7.5 milestone Jan 22, 2019
@ctran ctran merged commit 1992120 into ctran:develop Jan 22, 2019
@ctran
Copy link
Owner

ctran commented Jan 22, 2019

Thanks!!!

@NikoRoberts
Copy link

Whitespace is still added when there is a module wrapping the class

mgpnd pushed a commit to mgpnd/annotate_models that referenced this pull request Feb 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants