🚨 fix warnings
This commit is contained in:
parent
0f6f08654f
commit
9bc244be47
@ -1627,10 +1627,8 @@ The library itself consists of a single header file licensed under the MIT licen
|
||||
- [**libFuzzer**](https://llvm.org/docs/LibFuzzer.html) to implement fuzz testing for OSS-Fuzz
|
||||
- [**OSS-Fuzz**](https://github.com/google/oss-fuzz) for continuous fuzz testing of the library ([project repository](https://github.com/google/oss-fuzz/tree/master/projects/json))
|
||||
- [**Probot**](https://probot.github.io) for automating maintainer tasks such as closing stale issues, requesting missing information, or detecting toxic comments.
|
||||
- [**send_to_wandbox**](https://github.com/nlohmann/json/blob/develop/doc/scripts/send_to_wandbox.py) to send code examples to [Wandbox](https://wandbox.org)
|
||||
- [**Travis**](https://travis-ci.org) for [continuous integration](https://travis-ci.org/nlohmann/json) on Linux and macOS
|
||||
- [**Valgrind**](https://valgrind.org) to check for correct memory management
|
||||
- [**Wandbox**](https://wandbox.org) for [online examples](https://wandbox.org/permlink/1mp10JbaANo6FUc7)
|
||||
|
||||
|
||||
## Projects using JSON for Modern C++
|
||||
|
||||
@ -44,7 +44,7 @@ constexpr bool is_number() const noexcept
|
||||
--8<-- "examples/is_number.output"
|
||||
```
|
||||
|
||||
# See also
|
||||
## See also
|
||||
|
||||
- [is_number_integer()](is_number_integer.md) check if value is an integer or unsigned integer number
|
||||
- [is_number_unsigned()](is_number_unsigned.md) check if value is an unsigned integer number
|
||||
|
||||
@ -35,7 +35,7 @@ Constant.
|
||||
--8<-- "examples/is_number_float.output"
|
||||
```
|
||||
|
||||
# See also
|
||||
## See also
|
||||
|
||||
- [is_number()](is_number.md) check if value is a number
|
||||
- [is_number_integer()](is_number_integer.md) check if value is an integer or unsigned integer number
|
||||
|
||||
@ -35,7 +35,7 @@ Constant.
|
||||
--8<-- "examples/is_number_integer.output"
|
||||
```
|
||||
|
||||
# See also
|
||||
## See also
|
||||
|
||||
- [is_number()](is_number.md) check if value is a number
|
||||
- [is_number_unsigned()](is_number_unsigned.md) check if value is an unsigned integer number
|
||||
|
||||
@ -35,7 +35,7 @@ Constant.
|
||||
--8<-- "examples/is_number_unsigned.output"
|
||||
```
|
||||
|
||||
# See also
|
||||
## See also
|
||||
|
||||
- [is_number()](is_number.md) check if value is a number
|
||||
- [is_number_integer()](is_number_integer.md) check if value is an integer or unsigned integer number
|
||||
|
||||
@ -54,7 +54,7 @@ This library extends primitive types to binary types, because binary types are
|
||||
--8<-- "examples/is_primitive.output"
|
||||
```
|
||||
|
||||
# See also
|
||||
## See also
|
||||
|
||||
- [is_structured()](is_structured.md) returns whether JSON value is structured
|
||||
- [is_null()](is_null.md) returns whether JSON value is `null`
|
||||
|
||||
@ -52,7 +52,7 @@ Note that though strings are containers in C++, they are treated as primitive va
|
||||
--8<-- "examples/is_structured.output"
|
||||
```
|
||||
|
||||
# See also
|
||||
## See also
|
||||
|
||||
- [is_primitive()](is_primitive.md) returns whether JSON value is primitive
|
||||
- [is_array()](is_array.md) returns whether value is an array
|
||||
|
||||
@ -51,7 +51,7 @@ called:
|
||||
Whether the JSON value which called the function during parsing should be kept (`#!cpp true`) or not (`#!cpp false`). In
|
||||
the latter case, it is either skipped completely or replaced by an empty discarded object.
|
||||
|
||||
# Example
|
||||
## Examples
|
||||
|
||||
??? example
|
||||
|
||||
|
||||
@ -33,16 +33,26 @@ def check_structure():
|
||||
'Version history'
|
||||
]
|
||||
|
||||
for file in sorted(glob.glob('api/**/*.md', recursive=True)):
|
||||
files = sorted(glob.glob('api/**/*.md', recursive=True))
|
||||
for file in files:
|
||||
with open(file) as file_content:
|
||||
header_idx = -1
|
||||
existing_headers = []
|
||||
in_initial_code_example = False
|
||||
previous_line = None
|
||||
h1sections = 0
|
||||
|
||||
for lineno, line in enumerate(file_content.readlines()):
|
||||
line = line.strip()
|
||||
|
||||
if line.startswith('# '):
|
||||
h1sections += 1
|
||||
|
||||
# there should only be one top-level title
|
||||
if h1sections > 1:
|
||||
print(f'{file}:{lineno+1}: Error: unexpected top-level title "{line}"!')
|
||||
h1sections = 1
|
||||
|
||||
# Overview pages should have a better title
|
||||
if line == '# Overview':
|
||||
print(f'{file}:{lineno+1}: Error: overview pages should have a better title!')
|
||||
@ -85,6 +95,7 @@ def check_structure():
|
||||
if required_header not in existing_headers:
|
||||
print(f'{file}:{lineno+1}: Error: required header "{required_header}" was not found!')
|
||||
|
||||
print(f'\nchecked {len(files)} files')
|
||||
|
||||
if __name__ == '__main__':
|
||||
check_structure()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user