Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Update cpplint.py to r456 - rebased #22

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

Closed
wants to merge 7 commits into from

Conversation

tkruse
Copy link
Contributor

@tkruse tkruse commented Jul 4, 2016

So this is my attempt at fixing the merge conflict in #19. I guess this may break several tests, so there may be several iterations to do. The main conflicts to solve were about the _IsSourceExtension() function and the _test_suffixes variable.

As a sidenote, it would be nicer to keep the git history clean, by fetching commit from the google styleguide and making a merge commit, where the merge result would be something like this PR.

456 - Tweak lint to sometimes allow { on line following array initialization.
455 - Recognize more types.
454 - Try a bit harder to detect templated types.
453 - Changed error message wording on build/storage_class to be less ambiguous.
452 - Recognize more types to silence false positives for brace warnings.
451 -
450 -
449 - Ignore whitespace/tab for Linux Kernel files.
448 - Remove some more false positive lint warnings for int64{n}.
447 - Just one warning message for line length is enough, don't need two.
446 - Allow braced conversions to int16, uint64, etc. per the style guide.
445 - Fixed handling of backslash escapes for checking whether a "//" is quoted.
444 - Reduced dependency on hardcoded .cc extension.
443 - Disable single-arg constructor checks by default, since ClangTidy has the
same check. We could just delete the check entirely, but it's slightly
useful in places that can't run ClangTidy.
442 - Fix matching of macro names in CheckTrailingSemicolon to include digits.
441 - Deleted checks:
- All checks for RValue references.
- Spacing check around boolean &&, because those look like RValue
references.
A huge amount of code and effort were dedicated to tell RValue
references apart from boolean expressions, and to differentiate
allowed versus banned RValue references. But we still get regular
false positives from this one check. Rather than making the check
more complex than what it already is, it seemed safer to just delete
it altogether for now, and have a different process for catching
RValue references.
440 - Add rule to cpplint to throw error on empty if statement bodies without
else clauses. If statement bodies with comments are not considered empty.
439 - Allow spaces before closing brace of namespace block so that namespaces
inside of macro definitions (where the entire macro definition is
indented) are not treated as errors.
438 - cpplint: fix a false positive on new const int(x).
437 - Only check for function length when current line is inside a function.
436 - cpplint: Catch static std::string instances as well as those written as
string. Previously users would sometimes work around the lint warning by
changing their code to even worse code by adding the "std::" prefix.
435 - cpplint: Be a little smarter about warning on indentation.
434 - cpplint: Remove false positives on some functions returning string const&.
433 - cpplint: improve diagnostics of global/static string objects.
432 - Allow non-const reference parameters for iostream based types.
431 - Better handling of raw strings inside comments.
430 -
429 -
428 -
427 - Add support to CHECK_NOTNULL when checking if a member variable is
initialized with itself.
426 - Allow suppressing specific warnings in C headers.
425 - Allow spaces before parens for inline assembly.
424 - Remove lint checks for {EXPECT,ASSERT}_.*_M.
423 - Allow comment lines of more than 80 characters if they contain a single
"word" (without any spaces).
422 - cpplint: Warn on inclusion of C++14 headers.
421 - cpplint: recognize <shared_mutex> as a standard library header.
420 - Add <scoped_allocator> to cpplint's list of C++ standard headers.
419 - Add cpplint check for tr1/ headers. We removed the nanny guards for these
418 -
417 - Update the styleguide and cpplint to allow unnamed parameters
416 - Remove the rule explicitly banning non-default move operations.
415 - Remove the check for explicit multi arg constructors
414 - Include clarity of lambda default captures in "pros" section, mention
of capturing this and lambdas which escape the current scope in "cons".
Soften the ban on default captures to a preference, with admonition against
using them for capturing this or when they will escape the current scope.
This is a fairly straightforward change with a brief inclusion
of 2 problematic cases for implicit capture. As this is the style
guide, I'm not sure how much more detail is appropriate.
413 - Fixed a bug by making regex in CleanseRawStrings match multiple raw strings
on a single line in left-to-right order.
412 - Fixed false positive for classes derived using decltype()
411 -
410 - Recognize '1LL<<20' as numeric and don't flag it for spacing.

Conflicts:

cpplint.py

cpplint_unittest.py

Conflicts:

cpplint.py

cpplint_unittest.py

@tkruse tkruse force-pushed the google-update-merged branch from 1af9e6a to d81bd04 Compare July 4, 2016 21:35
@tkruse
Copy link
Contributor Author

tkruse commented Jul 4, 2016

I think all current PRs have their unit tests and style checks passed, only thing breaking are cli_tests, those need to be fixed on master first, then fixed for each PR. I can work on that before end of the week I guess. Most should be just confirming that with new / removed features, the output changes.

@tkruse tkruse force-pushed the google-update-merged branch from d81bd04 to a64fc56 Compare July 6, 2016 13:45
@tkruse
Copy link
Contributor Author

tkruse commented Jul 6, 2016

After rebase pylint and cli_tests still fail, which is fair enough (google removed some features in these commits), so probably wont take long to fix.

tkruse added 2 commits July 6, 2016 22:35
456 - Tweak lint to sometimes allow { on line following array initialization.
455 - Recognize more types.
454 - Try a bit harder to detect templated types.
453 - Changed error message wording on build/storage_class to be less ambiguous.
452 - Recognize more types to silence false positives for brace warnings.
451 - <skipped>
450 - <skipped>
449 - Ignore whitespace/tab for Linux Kernel files.
448 - Remove some more false positive lint warnings for int64{n}.
447 - Just one warning message for line length is enough, don't need two.
446 - Allow braced conversions to int16, uint64, etc. per the style guide.
445 - Fixed handling of backslash escapes for checking whether a "//" is quoted.
444 - Reduced dependency on hardcoded .cc extension.
443 - Disable single-arg constructor checks by default, since ClangTidy has the
      same check. We could just delete the check entirely, but it's slightly
      useful in places that can't run ClangTidy.
442 - Fix matching of macro names in CheckTrailingSemicolon to include digits.
441 - Deleted checks:
      - All checks for RValue references.
      - Spacing check around boolean &&, because those look like RValue
        references.
      A huge amount of code and effort were dedicated to tell RValue
      references apart from boolean expressions, and to differentiate
      allowed versus banned RValue references. But we still get regular
      false positives from this one check. Rather than making the check
      more complex than what it already is, it seemed safer to just delete
      it altogether for now, and have a different process for catching
      RValue references.
440 - Add rule to cpplint to throw error on empty if statement bodies without
      else clauses. If statement bodies with comments are not considered empty.
439 - Allow spaces before closing brace of namespace block so that namespaces
      inside of macro definitions (where the entire macro definition is
      indented) are not treated as errors.
438 - cpplint: fix a false positive on `new const int(x)`.
437 - Only check for function length when current line is inside a function.
436 - cpplint: Catch static `std::string` instances as well as those written as
      `string`. Previously users would sometimes work around the lint warning by
      changing their code to even worse code by adding the "std::" prefix.
435 - cpplint: Be a little smarter about warning on indentation.
434 - cpplint: Remove false positives on some functions returning string const&.
433 - cpplint: improve diagnostics of global/static string objects.
432 - Allow non-const reference parameters for iostream based types.
431 - Better handling of raw strings inside comments.
430 - <noop>
429 - <skipped>
428 - <skipped>
427 - Add support to CHECK_NOTNULL when checking if a member variable is
      initialized with itself.
426 - Allow suppressing specific warnings in C headers.
425 - Allow spaces before parens for inline assembly.
424 - Remove lint checks for {EXPECT,ASSERT}_.*_M.
423 - Allow comment lines of more than 80 characters if they contain a single
      "word" (without any spaces).
422 - cpplint: Warn on inclusion of C++14 headers.
421 - cpplint: recognize <shared_mutex> as a standard library header.
420 - Add <scoped_allocator> to cpplint's list of C++ standard headers.
419 - Add cpplint check for tr1/ headers. We removed the nanny guards for these
418 - <skipped>
417 - Update the styleguide and cpplint to allow unnamed parameters
416 - Remove the rule explicitly banning non-default move operations.
415 - Remove the check for explicit multi arg constructors
414 - Include clarity of lambda default captures in "pros" section, mention
      of capturing `this` and lambdas which escape the current scope in "cons".
      Soften the ban on default captures to a preference, with admonition against
      using them for capturing `this` or when they will escape the current scope.
      This is a fairly straightforward change with a brief inclusion
      of 2 problematic cases for implicit capture. As this is the style
      guide, I'm not sure how much more detail is appropriate.
413 - Fixed a bug by making regex in CleanseRawStrings match multiple raw strings
      on a single line in left-to-right order.
412 - Fixed false positive for classes derived using decltype()
411 - <skipped>
410 - Recognize '1LL<<20' as numeric and don't flag it for spacing.

# Conflicts:
#	cpplint.py
#	cpplint_unittest.py

# Conflicts:
#	cpplint.py
#	cpplint_unittest.py
@tkruse tkruse force-pushed the google-update-merged branch from a64fc56 to 4001b78 Compare July 6, 2016 21:01
@tkruse tkruse force-pushed the google-update-merged branch from 4001b78 to edd41f7 Compare July 6, 2016 21:21
@tkruse
Copy link
Contributor Author

tkruse commented Jul 6, 2016

Hi Andrew,
I fixed the pylint issue and adapted to all changes that seemed legit to me. However there remains some differences regarding include_what_you_use. SInce you had a look before, maybe you'll easily see if those are legit or regressions:
https://gist.github.com/tkruse/7e9b71eca7c01fb015a529676e3c8255

@theandrewdavis
Copy link
Contributor

OK, I've pushed your commits and added commits to resolve the remaining differences in the regression tests. Almost everything is a result of cpplint changnig (so not regressions). One bug had to do with include what you use and the new --extensions and --headers changes, but that's fixed now

@tkruse
Copy link
Contributor Author

tkruse commented Jul 10, 2016

cool, great. I guess a new release is possible. The other PRs I harvested from Google at my fork all more controversial, I cannot decide if they add enough value, and I did not review them for bugs: https://github.com/tkruse/cpplint/pulls. So I wont even open them here, unless you want me to.

Since you do not maintain a git merge history from the google original repo, I think it would be good if the README.md stated the point of last merge, i,.e. "f15e633de5b716a9 from 2016-07-06"

Even better would be to create a branch "google" or so, that follow the "gh-pages" branch at google, and make a no-op merge into the current master.

@thomasjo
Copy link

Even better would be to create a branch "google" or so, that follow the "gh-pages" branch at google, and make a no-op merge into the current master.

Sounds like a good plan!

@theandrewdavis
Copy link
Contributor

Even better would be to create a branch "google" or so, that follow the "gh-pages" branch at google, and make a no-op merge into the current master.

Yep, I agree. I added a "google" branch and did a merge (choosing "ours" for all conflicts) and pushed that. So in the future I should be able to pull changes from google into the google branch and then rebase those changes on top of this repo's master.

I've signed up for the RSS feed to commits to their github repo so hopefully I can stay on top of changes as they happen.

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