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-2248 Refactor string::join_pack #1680

Closed
wants to merge 4 commits into from

Conversation

szaszm
Copy link
Member

@szaszm szaszm commented Oct 12, 2023

  • remove obsolete -fconcepts flag from RangeV3.cmake
  • disable readability/braces of cpplint, because it can't handle concepts

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.

}
template<typename Str> struct char_type_of_impl {};
template<typename CharT> struct char_type_of_impl<std::basic_string<CharT>> : std::type_identity<CharT> {};
template<typename CharT> struct char_type_of_impl<CharT*> : std::type_identity<std::remove_cv_t<CharT>> {};
Copy link
Member Author

Choose a reason for hiding this comment

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

const char* and char* are both considered strings of char.

template<typename CharT> struct char_type_of_impl<std::basic_string<CharT>> : std::type_identity<CharT> {};
template<typename CharT> struct char_type_of_impl<CharT*> : std::type_identity<std::remove_cv_t<CharT>> {};
template<typename CharT> struct char_type_of_impl<std::basic_string_view<CharT>> : std::type_identity<CharT> {};
template<typename Str> using char_type_of = typename char_type_of_impl<std::decay_t<Str>>::type;
Copy link
Member Author

Choose a reason for hiding this comment

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

Decay here is intentional: not only do we want to ignore cv-qualifiers and references, but char arrays should be decayed to pointers, to match the second specialization above.

@@ -1,2 +1,2 @@
set noparent
filter=-runtime/reference,-runtime/string,-build/c++11,-build/include_subdir,-whitespace/forcolon,-build/namespaces_literals,-readability/check,-build/include_what_you_use,-readability/nolint
filter=-runtime/reference,-runtime/string,-build/c++11,-build/include_subdir,-whitespace/forcolon,-build/namespaces_literals,-readability/check,-build/include_what_you_use,-readability/nolint,-readability/braces
Copy link
Member Author

Choose a reason for hiding this comment

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

Got this after both concept declarations:

/home/szaszm/nifi-minifi-cpp-3/libminifi/include/utils/StringUtils.h:193:  You don't need a ; after a }  [readability/braces] [4]

Copy link
Contributor

Choose a reason for hiding this comment

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

@martinzink has an open issue for this for a while now google/styleguide#752

Copy link
Member Author

@szaszm szaszm Oct 20, 2023

Choose a reason for hiding this comment

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

To be honest, I have the feeling that we would be better off by dropping cpplint, and rely more on clang-tidy, especially as you recent changes in #1671 get ready and do the google-specific checks.
Too many false positives, and it looks outdated barely maintained. On the other hand, it runs much faster than clang-tidy.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's still worth having cpplint as well, I didn't encounter too many false positives and it has checks that clang tidy does not. It also runs on the Windows codebase while clang tidy only runs on Linux at the moment.

@@ -1,2 +1,2 @@
set noparent
filter=-runtime/reference,-runtime/string,-build/c++11,-build/include_subdir,-whitespace/forcolon,-build/namespaces_literals,-readability/check,-build/include_what_you_use,-readability/nolint
filter=-runtime/reference,-runtime/string,-build/c++11,-build/include_subdir,-whitespace/forcolon,-build/namespaces_literals,-readability/check,-build/include_what_you_use,-readability/nolint,-readability/braces
Copy link
Contributor

Choose a reason for hiding this comment

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

@martinzink has an open issue for this for a while now google/styleguide#752

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.

5 participants