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

MINIFICPP-2161 Upgrade cpplint to support C++20 #1607

Conversation

fgerlits
Copy link
Contributor

@fgerlits fgerlits commented Jul 17, 2023

This is https://github.com/cpplint/cpplint/blob/7b88b68187e3516540fab3caa900988d2179ed24/cpplint.py with the following changes:

  • add git hash as version string
  • ignore clang-tidy NOLINT prefixes
  • main() takes the file list from an argument instead of sys.argv[1:]
--- https://github.com/cpplint/cpplint/blob/7b88b68187e3516540fab3caa900988d2179ed24/cpplint.py
+++ src/minifi/thirdparty/google-styleguide/cpplint.py
@@ -64,7 +64,7 @@ import xml.etree.ElementTree
 # if empty, use defaults
 _valid_extensions = set([])
 
-__VERSION__ = '1.6.1'
+__VERSION__ = '7b88b68187e3516540fab3caa900988d2179ed24'
 
 try:
   #  -- pylint: disable=used-before-assignment
@@ -378,7 +378,19 @@ _LEGACY_ERROR_CATEGORIES = [
 # These prefixes for categories should be ignored since they relate to other
 # tools which also use the NOLINT syntax, e.g. clang-tidy.
 _OTHER_NOLINT_CATEGORY_PREFIXES = [
-    'clang-analyzer',
+    'boost-',
+    'bugprone-',
+    'cert-',
+    'clang-analyzer-',
+    'concurrency-'
+    'cppcoreguidelines-',
+    'google-',
+    'hicpp-',
+    'misc-',
+    'modernize-',
+    'performance-',
+    'portability-',
+    'readability-',
     ]
 
 # The default state of the category filter. This is overridden by the --filter=
@@ -6911,8 +6923,8 @@ def _IsParentOrSame(parent, child):
   child_suffix = child_suffix.lstrip(os.sep)
   return child == os.path.join(prefix, child_suffix)
 
-def main():
-  filenames = ParseArguments(sys.argv[1:])
+def main(arg):
+  filenames = ParseArguments(arg)
   backup_err = sys.stderr
   try:
     # Change stderr to write with replacement characters so we don't die
@@ -6936,4 +6948,4 @@ def main():
 
 
 if __name__ == '__main__':
-  main()
+  main(sys.argv[1:])

Thank you for submitting a contribution to Apache NiFi - MiNiFi C++.

In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:

For all changes:

  • Is there a JIRA ticket associated with this PR? Is it referenced
    in the commit message?

  • Does your PR title start with MINIFICPP-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.

  • Has your PR been rebased against the latest commit within the target branch (typically main)?

  • Is your initial contribution a single, squashed commit?

For code changes:

  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE file?
  • If applicable, have you updated the NOTICE file?

For documentation related changes:

  • Have you ensured that format looks appropriate for the output in which it is rendered?

Note:

Please ensure that once the PR is submitted, you check GitHub Actions CI results for build issues and submit an update to your PR as soon as possible.

fgerlits added a commit to fgerlits/nifi-minifi-cpp that referenced this pull request Jul 17, 2023
…erloads in ProcessContext.h

also: remove a templated getProperty() overload, as it was only ever used with T = std::string
TODO: if apache#1607 gets merged before this, reorder the c++ system includes in ProcessContext.h in lexicographic order
This is
https://github.com/cpplint/cpplint/blob/7b88b68187e3516540fab3caa900988d2179ed24/cpplint.py
with the following changes:
- add git hash as version string
- ignore clang-tidy NOLINT prefixes
- main() takes the file list from an argument instead of sys.argv[1:]
@fgerlits fgerlits force-pushed the MINIFICPP-2161_Upgrade-cpplint-to-support-C++20 branch from 866da1c to 329e335 Compare July 17, 2023 16:32
@lordgamez lordgamez closed this in 26d68d9 Jul 18, 2023
fgerlits added a commit to fgerlits/nifi-minifi-cpp that referenced this pull request Jul 19, 2023
…erloads in ProcessContext.h

also: remove a templated getProperty() overload, as it was only ever used with T = std::string
TODO: if apache#1607 gets merged before this, reorder the c++ system includes in ProcessContext.h in lexicographic order
@fgerlits fgerlits deleted the MINIFICPP-2161_Upgrade-cpplint-to-support-C++20 branch August 15, 2023 08:41
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.

4 participants