Skip to content

Refine CPPLINT script to not report __CPROVER_ usage outside of strings #5000

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 2 commits into from
Aug 9, 2019

Conversation

angelhof
Copy link
Contributor

@angelhof angelhof commented Aug 8, 2019

This commit refines the CPPLINT script to only report __CPROVER_ usages in strings (and not in function names for example).

I also removed several unnecessary NOLINT comments.

…itive

Change r'.*__CPROVER_.*' with r'.*"([^"\\]|\\.)*__CPROVER_([^"\\]|\\.)*".*'
so that only occurrences of __CPROVER_ in strings are caught. Note that
this check will still erroneously complain for the following
 "foo" __CPROVER_func() "bar"
@angelhof angelhof marked this pull request as ready for review August 8, 2019 21:00
@codecov-io
Copy link

Codecov Report

Merging #5000 into develop will decrease coverage by 0.18%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #5000      +/-   ##
===========================================
- Coverage    69.43%   69.24%   -0.19%     
===========================================
  Files         1310     1309       -1     
  Lines       108736   108453     -283     
===========================================
- Hits         75497    75096     -401     
- Misses       33239    33357     +118
Impacted Files Coverage Δ
unit/testing-utils/require_expr.cpp 0% <0%> (-34.38%) ⬇️
...bytecode_convert_method/convert_invoke_dynamic.cpp 76.44% <0%> (-23.08%) ⬇️
...nit/java-testing-utils/require_goto_statements.cpp 92.61% <0%> (-6.05%) ⬇️
src/goto-programs/slice_global_inits.cpp 88% <0%> (-3.67%) ⬇️
src/util/mathematical_expr.h 90.47% <0%> (-2.63%) ⬇️
src/goto-symex/goto_symex.cpp 96.77% <0%> (-2.39%) ⬇️
src/util/namespace.cpp 78.33% <0%> (-1.67%) ⬇️
...c/goto-harness/memory_snapshot_harness_generator.h 87.5% <0%> (-1.39%) ⬇️
src/ansi-c/c_typecheck_expr.cpp 72.52% <0%> (-1.27%) ⬇️
src/util/std_code.h 91.18% <0%> (-1.13%) ⬇️
... and 52 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 719e9a9...60c49fd. Read the comment docs.

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

⚠️
This PR failed Diffblue compatibility checks (cbmc commit: 60c49fd).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/122513922
Status will be re-evaluated on next push.
Common spurious failures include: the cbmc commit has disappeared in the mean time (e.g. in a force-push); the author is not in the list of contributors (e.g. first-time contributors); compatibility was already broken by an earlier merge.

Copy link
Contributor

@thk123 thk123 left a comment

Choose a reason for hiding this comment

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

I won't block this PR as cpplint.py doesn't even have any tests running in CI - but I think it'd be really great to have a few tests of that regex so it is clearer what it does and does not match

@tautschnig tautschnig merged commit 8099af0 into diffblue:develop Aug 9, 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.

6 participants