🚨 fix linter warnings
This commit is contained in:
parent
d54fd35355
commit
09da90eb76
@ -1,38 +1,38 @@
|
|||||||
# basic_json::basic_json
|
# basic_json::basic_json
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
// 1
|
// (1)
|
||||||
basic_json(const value_t v);
|
basic_json(const value_t v);
|
||||||
|
|
||||||
// 2
|
// (2)
|
||||||
basic_json(std::nullptr_t = nullptr) noexcept;
|
basic_json(std::nullptr_t = nullptr) noexcept;
|
||||||
|
|
||||||
// 3
|
// (3)
|
||||||
template<typename CompatibleType>
|
template<typename CompatibleType>
|
||||||
basic_json(CompatibleType&& val) noexcept(noexcept(
|
basic_json(CompatibleType&& val) noexcept(noexcept(
|
||||||
JSONSerializer<U>::to_json(std::declval<basic_json_t&>(),
|
JSONSerializer<U>::to_json(std::declval<basic_json_t&>(),
|
||||||
std::forward<CompatibleType>(val))));
|
std::forward<CompatibleType>(val))));
|
||||||
|
|
||||||
// 4
|
// (4)
|
||||||
template<typename BasicJsonType>
|
template<typename BasicJsonType>
|
||||||
basic_json(const BasicJsonType& val);
|
basic_json(const BasicJsonType& val);
|
||||||
|
|
||||||
// 5
|
// (5)
|
||||||
basic_json(initializer_list_t init,
|
basic_json(initializer_list_t init,
|
||||||
bool type_deduction = true,
|
bool type_deduction = true,
|
||||||
value_t manual_type = value_t::array);
|
value_t manual_type = value_t::array);
|
||||||
|
|
||||||
// 6
|
// (6)
|
||||||
basic_json(size_type cnt, const basic_json& val);
|
basic_json(size_type cnt, const basic_json& val);
|
||||||
|
|
||||||
// 7
|
// (7)
|
||||||
basic_json(iterator first, iterator last);
|
basic_json(iterator first, iterator last);
|
||||||
basic_json(const_iterator first, const_iterator last);
|
basic_json(const_iterator first, const_iterator last);
|
||||||
|
|
||||||
// 8
|
// (8)
|
||||||
basic_json(const basic_json& other);
|
basic_json(const basic_json& other);
|
||||||
|
|
||||||
// 9
|
// (9)
|
||||||
basic_json(basic_json&& other) noexcept;
|
basic_json(basic_json&& other) noexcept;
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@ template<typename KeyT>
|
|||||||
bool contains(KeyT && key) const;
|
bool contains(KeyT && key) const;
|
||||||
|
|
||||||
// (2)
|
// (2)
|
||||||
bool contains(const json_pointer& ptr) const
|
bool contains(const json_pointer& ptr) const;
|
||||||
```
|
```
|
||||||
|
|
||||||
1. Check whether an element exists in a JSON object with key equivalent to `key`. If the element is not found or the
|
1. Check whether an element exists in a JSON object with key equivalent to `key`. If the element is not found or the
|
||||||
|
|||||||
@ -5,7 +5,7 @@ template<typename KeyT>
|
|||||||
iterator find(KeyT&& key);
|
iterator find(KeyT&& key);
|
||||||
|
|
||||||
template<typename KeyT>
|
template<typename KeyT>
|
||||||
const_iterator find(KeyT&& key) const
|
const_iterator find(KeyT&& key) const;
|
||||||
```
|
```
|
||||||
|
|
||||||
Finds an element in a JSON object with key equivalent to `key`. If the element is not found or the JSON value is not an
|
Finds an element in a JSON object with key equivalent to `key`. If the element is not found or the JSON value is not an
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
template<typename ValueType>
|
template<typename ValueType>
|
||||||
ValueType& get_to(ValueType& v) const noexcept(
|
ValueType& get_to(ValueType& v) const noexcept(
|
||||||
noexcept(JSONSerializer<ValueType>::from_json(
|
noexcept(JSONSerializer<ValueType>::from_json(
|
||||||
std::declval<const basic_json_t&>(), v)))
|
std::declval<const basic_json_t&>(), v)));
|
||||||
```
|
```
|
||||||
|
|
||||||
Explicit type conversion between the JSON value and a compatible value. The value is filled into the input parameter by
|
Explicit type conversion between the JSON value and a compatible value. The value is filled into the input parameter by
|
||||||
|
|||||||
@ -1,11 +1,9 @@
|
|||||||
# basic_json::object_comparator_t
|
# basic_json::object_comparator_t
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
// until C++14
|
using object_comparator_t = std::less<StringType>; // until C++14
|
||||||
using object_comparator_t = std::less<StringType>;
|
|
||||||
|
|
||||||
// since C++14
|
using object_comparator_t = std::less<>; // since C++14
|
||||||
using object_comparator_t = std::less<>;
|
|
||||||
```
|
```
|
||||||
|
|
||||||
The comparator used in [`object_t`](object_t.md).
|
The comparator used in [`object_t`](object_t.md).
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
# operator>>(basic_json)
|
# operator>>(basic_json)
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
std::istream& operator>>(std::istream& i, basic_json& j)
|
std::istream& operator>>(std::istream& i, basic_json& j);
|
||||||
```
|
```
|
||||||
|
|
||||||
Deserializes an input stream to a JSON value.
|
Deserializes an input stream to a JSON value.
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
# basic_json::operator""_json
|
# basic_json::operator""_json
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
json operator "" _json(const char* s, std::size_t n)
|
json operator "" _json(const char* s, std::size_t n);
|
||||||
```
|
```
|
||||||
|
|
||||||
This operator implements a user-defined string literal for JSON objects. It can be used by adding `#!cpp _json` to a
|
This operator implements a user-defined string literal for JSON objects. It can be used by adding `#!cpp _json` to a
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
# basic_json::operator""_json_pointer
|
# basic_json::operator""_json_pointer
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
json_pointer operator "" _json_pointer(const char* s, std::size_t n)
|
json_pointer operator "" _json_pointer(const char* s, std::size_t n);
|
||||||
```
|
```
|
||||||
|
|
||||||
This operator implements a user-defined string literal for JSON Pointers. It can be used by adding `#!cpp _json_pointer`
|
This operator implements a user-defined string literal for JSON Pointers. It can be used by adding `#!cpp _json_pointer`
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
# basic_json::operator<
|
# basic_json::operator<
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
bool operator<(const_reference lhs, const_reference rhs) noexcept,
|
bool operator<(const_reference lhs, const_reference rhs) noexcept;
|
||||||
|
|
||||||
template<typename ScalarType>
|
template<typename ScalarType>
|
||||||
bool operator<(const_reference lhs, const ScalarType rhs) noexcept;
|
bool operator<(const_reference lhs, const ScalarType rhs) noexcept;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
# operator<<(basic_json)
|
# operator<<(basic_json)
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
std::ostream& operator<<(std::ostream& o, const basic_json& j)
|
std::ostream& operator<<(std::ostream& o, const basic_json& j);
|
||||||
```
|
```
|
||||||
|
|
||||||
Serialize the given JSON value `j` to the output stream `o`. The JSON value will be serialized using the
|
Serialize the given JSON value `j` to the output stream `o`. The JSON value will be serialized using the
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
template <typename BasicJsonType>
|
template <typename BasicJsonType>
|
||||||
std::string to_string(const BasicJsonType& j)
|
std::string to_string(const BasicJsonType& j);
|
||||||
```
|
```
|
||||||
|
|
||||||
This function implements a user-defined to_string for JSON objects.
|
This function implements a user-defined to_string for JSON objects.
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
# basic_json::~basic_json
|
# basic_json::~basic_json
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
~basic_json() noexcept
|
~basic_json() noexcept;
|
||||||
```
|
```
|
||||||
|
|
||||||
Destroys the JSON value and frees all allocated memory.
|
Destroys the JSON value and frees all allocated memory.
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
template<typename BinaryType>
|
template<typename BinaryType>
|
||||||
class byte_container_with_subtype : public BinaryType
|
class byte_container_with_subtype : public BinaryType;
|
||||||
```
|
```
|
||||||
|
|
||||||
This type extends the template parameter `BinaryType` provided to [`basic_json`](../basic_json/index.md) with a subtype
|
This type extends the template parameter `BinaryType` provided to [`basic_json`](../basic_json/index.md) with a subtype
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
# byte_container_with_subtype::set_subtype
|
# byte_container_with_subtype::set_subtype
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
void set_subtype(subtype_type subtype) noexcept
|
void set_subtype(subtype_type subtype) noexcept;
|
||||||
```
|
```
|
||||||
|
|
||||||
Sets the binary subtype of the value, also flags a binary JSON value as having a subtype, which has implications for
|
Sets the binary subtype of the value, also flags a binary JSON value as having a subtype, which has implications for
|
||||||
|
|||||||
@ -11,6 +11,9 @@ A floating-point number was read.
|
|||||||
`val` (in)
|
`val` (in)
|
||||||
: floating-point value
|
: floating-point value
|
||||||
|
|
||||||
|
`s` (in)
|
||||||
|
: string representation of the original input
|
||||||
|
|
||||||
## Return value
|
## Return value
|
||||||
|
|
||||||
Whether parsing should proceed.
|
Whether parsing should proceed.
|
||||||
|
|||||||
@ -36,10 +36,12 @@ def check_structure():
|
|||||||
with open(file) as file_content:
|
with open(file) as file_content:
|
||||||
header_idx = -1
|
header_idx = -1
|
||||||
existing_headers = []
|
existing_headers = []
|
||||||
|
in_initial_code_example = False
|
||||||
|
|
||||||
for lineno, line in enumerate(file_content.readlines()):
|
for lineno, line in enumerate(file_content.readlines()):
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
|
|
||||||
|
# check if headers are correct
|
||||||
if line.startswith('## '):
|
if line.startswith('## '):
|
||||||
header = line.strip('## ')
|
header = line.strip('## ')
|
||||||
existing_headers.append(header)
|
existing_headers.append(header)
|
||||||
@ -52,6 +54,17 @@ def check_structure():
|
|||||||
else:
|
else:
|
||||||
print(f'{file}:{lineno+1}: Error: header "{header}" is not part of the expected headers!')
|
print(f'{file}:{lineno+1}: Error: header "{header}" is not part of the expected headers!')
|
||||||
|
|
||||||
|
# code example
|
||||||
|
if line == '```cpp' and header_idx == -1:
|
||||||
|
in_initial_code_example = True
|
||||||
|
|
||||||
|
if in_initial_code_example and line.startswith('//'):
|
||||||
|
if any(map(str.isdigit, line)) and '(' not in line:
|
||||||
|
print(f'{file}:{lineno+1}: Number should be in parentheses: {line}')
|
||||||
|
|
||||||
|
if line == '```' and in_initial_code_example:
|
||||||
|
in_initial_code_example = False
|
||||||
|
|
||||||
for required_header in required_headers:
|
for required_header in required_headers:
|
||||||
if required_header not in existing_headers:
|
if required_header not in existing_headers:
|
||||||
print(f'{file}:{lineno+1}: Error: required header "{required_header}" was not found!')
|
print(f'{file}:{lineno+1}: Error: required header "{required_header}" was not found!')
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user