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

Remove blank newline in self-closing doc comment #613

Merged

Conversation

Projects
None yet
3 participants
@bonimy
Copy link
Contributor

bonimy commented Jan 6, 2019

Issue

Ending a doc comment with a self-closing XML tag will cause CodeMaid to add a trailing comment line.

Example

CodeMaid will format a document to look like the following

/// <seealso cref="IFormattable.ToString(String, IFormatProvider)"/>
///
public static string GetUIString(IFormattable value, string format = null)
{
    return value?.ToString(format, CurrentUICulture);
}

Resolution

Check whether a self-closing tag was the end of the XML comment block, and skip adding a new line if it is. Fixes #599.

Example

CodeMaid will format a document to look like the following

/// <seealso cref="IFormattable.ToString(String, IFormatProvider)"/>
public static string GetUIString(IFormattable value, string format = null)
{
    return value?.ToString(format, CurrentUICulture);
}

Tests

I could not set up unit tests in my environment, so I have no guarantees that this works outside of the test runs I did on my own projects.

Remove blank newline in self-closing doc comment
* Remove trailing commment marker at end of documentation comments
  that end with a self-closing tag.
* Fixes #599
@codecadwallader

This comment has been minimized.

Copy link
Owner

codecadwallader commented Jan 19, 2019

Thank you for providing this pull request! The logic looks very clean and concise to me and that is very much appreciated. Unfortunately I don't know this code area as well as its author who I hope can review it and let us know of any unintended consequences. @willemduncan can you please take a look?

@codecadwallader

This comment has been minimized.

Copy link
Owner

codecadwallader commented Jan 19, 2019

Also, I did run the unit tests with these changes and they still all passed. 👍

@willemduncan

This comment has been minimized.

Copy link
Collaborator

willemduncan commented Feb 10, 2019

Looks good to me, interesting that it never showed up (or was reported) before.

@codecadwallader

This comment has been minimized.

Copy link
Owner

codecadwallader commented Feb 16, 2019

Cool, thanks for confirming @willemduncan and thanks for the fix @bonimy . Merging in! :)

@codecadwallader codecadwallader added this to the v11.0 milestone Feb 16, 2019

@codecadwallader codecadwallader merged commit 41c2622 into codecadwallader:master Feb 16, 2019

1 check passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.