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

Ignore comment lines starting with certain prefixes #545

Merged
merged 1 commit into from Apr 28, 2018

Conversation

Projects
None yet
2 participants
@willemduncan
Collaborator

willemduncan commented Apr 26, 2018

Fixes #347, #350.

Ignore (ie output literally) any comment line starting with certain prefixes while formatting. Updated the comment regex, matching, and formatter. To prevent adding even more arguments to the function calls, two options classes have been added which are now used as arguments instead.

Lines starting with any of the tokens defined in the options for the Task List Window will be ignored. The tokens must be followed by a semicolon and a space to qualify, eg TODO: Lorem ipsum. Matching is case sensitive.

In addition, there is a new entry in the settings file to defining other tokens to ignore. For the moment, this only contains ReSharper disable and ReSharper enable. Once again, this is case sensitive.

Added a few unit tests to cover some obvious cases.

Ignore comment lines starting with certain prefixes
Fixes #347, #350.

Ignore (ie output literally) any comment line starting with certain
prefixes while formatting. The ignored prefixes are configured in
the setting file. Updated the comment regex, matching, and formatter.
@codecadwallader

This comment has been minimized.

Owner

codecadwallader commented Apr 28, 2018

Thanks for putting this together, it looks good to me and will merge in.

In general I think anything that is a setting has been exposed through the Options dialog, so it may be useful to add that for the IgnoreTokens as well for consistency.

@codecadwallader codecadwallader merged commit 3d15920 into codecadwallader:master Apr 28, 2018

1 check passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@codecadwallader codecadwallader added this to the v10.5 milestone Apr 28, 2018

@willemduncan willemduncan deleted the willemduncan:feat/ignorePrefixes branch Apr 28, 2018

@willemduncan

This comment has been minimized.

Collaborator

willemduncan commented Apr 28, 2018

I prefer to be on the "Joel Spolsky side" of things: don't bother users with too many settings ;) Yet I didn't want to hardcode ReSharper specific exceptions. As soon as more exceptions show up, or users request the ability to ignore more prefixes, we can either expose the settings or explain them how to manually edit the config.

Thanks for merging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment