Skip to content

Add option to exclude line patterns#117

Merged
myint merged 3 commits into
eddyxu:masterfrom
nitnelave:master
Jul 12, 2017
Merged

Add option to exclude line patterns#117
myint merged 3 commits into
eddyxu:masterfrom
nitnelave:master

Conversation

@nitnelave
Copy link
Copy Markdown
Contributor

This extends the functionality already provided of ignoring LCOV_EXCL_LINE and lines with only '}'.

You can now give on the command line (or in the yml) exclude-lines-pattern, a list of regex matching lines to ignore.

Moreover, this adds the default of also ignoring lines with only '};' (as created by the end of an array or a lambda).

Copy link
Copy Markdown
Collaborator

@myint myint left a comment

Choose a reason for hiding this comment

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

It looks good to me outside of my one comment.

Comment thread cpp_coveralls/coverage.py

args.exclude_lines_pattern.extend([
r'\bLCOV_EXCL_LINE\b',
r'^\s*};?\s*$',
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The original text.strip() == '}' did not have a semicolon.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Intended, for cases like:

auto my_lambda = [](){
  do_stuff();
};

Copy link
Copy Markdown
Collaborator

@myint myint Jul 12, 2017

Choose a reason for hiding this comment

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

Oh, I didn't notice the ?. I thought you were only handling };.

@myint myint merged commit c491409 into eddyxu:master Jul 12, 2017
@nitnelave
Copy link
Copy Markdown
Contributor Author

Any timeline on a release with that patch? I'm using pip to install cpp-coveralls on travis, I'd like to avoid having to clone it manually.

@eddyxu
Copy link
Copy Markdown
Owner

eddyxu commented Jul 26, 2017

@nitnelave Thanks a lot for the contribution! a fresh 0.4.0 version is released. Enjoy :)

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.

3 participants