mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-04-29 12:13:52 +00:00
Add and fix cpplint whitespace/comments (#434)
* Add whitespace/comments check * Adapt spacing in clang-format * Fix cpplint whitespace/comments issues * Grammar * Do not use clang-format for comment spacing * Fix with clang-format pre-commit hook
This commit is contained in:
parent
ba68040e92
commit
d8a5bdc294
@ -75,7 +75,7 @@ SortIncludes: true
|
||||
# SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeParens: Never
|
||||
# SpaceInEmptyParentheses: false
|
||||
# SpacesBeforeTrailingComments: 1
|
||||
SpacesBeforeTrailingComments: 2
|
||||
# SpacesInAngles: false
|
||||
# SpacesInContainerLiterals: true
|
||||
# SpacesInCStyleCastParentheses: false
|
||||
|
@ -1,7 +1,7 @@
|
||||
set noparent
|
||||
linelength=120 # As in .clang-format
|
||||
|
||||
# Non-used filters
|
||||
# Unused filters
|
||||
filter=-build/include_order # Requires unusual include order that encourages creating not self-contained headers
|
||||
filter=-readability/nolint # Conflicts with clang-tidy
|
||||
filter=-runtime/references # Requires fundamental change of API, don't see need for this
|
||||
@ -9,6 +9,3 @@ filter=-whitespace/blank_line # Unnecessarily strict with blank lines that othe
|
||||
filter=-whitespace/indent # Requires strange 3-space indent of private/protected/public markers
|
||||
filter=-whitespace/parens,-whitespace/braces # Conflict with clang-format
|
||||
|
||||
# Filters to be included in future
|
||||
filter=-whitespace/comments
|
||||
|
||||
|
@ -727,8 +727,8 @@ class Option : public OptionBase<Option> {
|
||||
/// Will include / prefer the positional name if positional is true.
|
||||
/// If all_options is false, pick just the most descriptive name to show.
|
||||
/// Use `get_name(true)` to get the positional name (replaces `get_pname`)
|
||||
std::string get_name(bool positional = false, //<[input] Show the positional name
|
||||
bool all_options = false //<[input] Show every option
|
||||
std::string get_name(bool positional = false, ///< Show the positional name
|
||||
bool all_options = false ///< Show every option
|
||||
) const {
|
||||
if(get_group().empty())
|
||||
return {}; // Hidden
|
||||
@ -974,7 +974,7 @@ class Option : public OptionBase<Option> {
|
||||
results_t res;
|
||||
if(results_.empty()) {
|
||||
if(!default_str_.empty()) {
|
||||
//_add_results takes an rvalue only
|
||||
// _add_results takes an rvalue only
|
||||
_add_result(std::string(default_str_), res);
|
||||
_validate_results(res);
|
||||
results_t extra;
|
||||
|
@ -780,7 +780,7 @@ class Transformer : public Validator {
|
||||
// if the type does not have first_type and second_type, these are both value_type
|
||||
using element_t = typename detail::element_type<T>::type; // Removes (smart) pointers if needed
|
||||
using item_t = typename detail::pair_adaptor<element_t>::first_type; // Is value_type if not a map
|
||||
using local_item_t = typename IsMemberType<item_t>::type; // This will convert bad types to good ones
|
||||
using local_item_t = typename IsMemberType<item_t>::type; // Will convert bad types to good ones
|
||||
// (const char * to std::string)
|
||||
|
||||
// Make a local copy of the filter function, using a std::function if not one already
|
||||
@ -838,10 +838,9 @@ class CheckedTransformer : public Validator {
|
||||
// if the type does not have first_type and second_type, these are both value_type
|
||||
using element_t = typename detail::element_type<T>::type; // Removes (smart) pointers if needed
|
||||
using item_t = typename detail::pair_adaptor<element_t>::first_type; // Is value_type if not a map
|
||||
using local_item_t = typename IsMemberType<item_t>::type; // This will convert bad types to good ones
|
||||
using local_item_t = typename IsMemberType<item_t>::type; // Will convert bad types to good ones
|
||||
// (const char * to std::string)
|
||||
using iteration_type_t = typename detail::pair_adaptor<element_t>::value_type; // the type of the object pair //
|
||||
// the type of the object pair
|
||||
using iteration_type_t = typename detail::pair_adaptor<element_t>::value_type; // the type of the object pair
|
||||
|
||||
// Make a local copy of the filter function, using a std::function if not one already
|
||||
std::function<local_item_t(local_item_t)> filter_fn = filter_function;
|
||||
|
Loading…
x
Reference in New Issue
Block a user