Remove trailing space characters (#1256)

Also add two newlines

(rebased from `aaronfranke/formatting`)

resolves #1220

Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
This commit is contained in:
Christopher Dunn 2021-01-09 22:39:07 -06:00 committed by GitHub
parent 940982438d
commit be4a512887
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 38 additions and 38 deletions

View File

@ -4,7 +4,7 @@ WarningsAsErrors: ''
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false
FormatStyle: none
CheckOptions:
CheckOptions:
- key: modernize-use-using.IgnoreMacros
value: '0'
...

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
python $DIR/run-clang-format.py -r $DIR/../src/**/ $DIR/../include/**/
python $DIR/run-clang-format.py -r $DIR/../src/**/ $DIR/../include/**/

14
LICENSE
View File

@ -1,25 +1,25 @@
The JsonCpp library's source code, including accompanying documentation,
The JsonCpp library's source code, including accompanying documentation,
tests and demonstration applications, are licensed under the following
conditions...
Baptiste Lepilleur and The JsonCpp Authors explicitly disclaim copyright in all
jurisdictions which recognize such a disclaimer. In such jurisdictions,
Baptiste Lepilleur and The JsonCpp Authors explicitly disclaim copyright in all
jurisdictions which recognize such a disclaimer. In such jurisdictions,
this software is released into the Public Domain.
In jurisdictions which do not recognize Public Domain property (e.g. Germany as of
2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur and
The JsonCpp Authors, and is released under the terms of the MIT License (see below).
In jurisdictions which recognize Public Domain property, the user of this
software may choose to accept it either as 1) Public Domain, 2) under the
conditions of the MIT License (see below), or 3) under the terms of dual
In jurisdictions which recognize Public Domain property, the user of this
software may choose to accept it either as 1) Public Domain, 2) under the
conditions of the MIT License (see below), or 3) under the terms of dual
Public Domain/MIT License conditions described here, as they choose.
The MIT License is about as close to Public Domain as a license can get, and is
described in clear, concise terms at:
http://en.wikipedia.org/wiki/MIT_License
The full text of the MIT License follows:
========================================================================

View File

@ -146,7 +146,7 @@ def glob(dir_path,
entry_type = is_file and FILE_LINK or DIR_LINK
else:
entry_type = is_file and FILE or DIR
## print '=> type: %d' % entry_type,
## print '=> type: %d' % entry_type,
if (entry_type & entry_type_filter) != 0:
## print ' => KEEP'
yield os.path.join(dir_path, entry)

View File

@ -32,8 +32,8 @@ def fix_source_eol(path, is_dry_run = True, verbose = True, eol = '\n'):
if verbose:
print(is_dry_run and ' NEED FIX' or ' FIXED')
return True
##
##
##
##
##
##def _do_fix(is_dry_run = True):
## from waftools import antglob

View File

@ -20,7 +20,7 @@ def update_license(path, dry_run, show_diff):
dry_run: if True, just print the path of the file that would be updated,
but don't change it.
show_diff: if True, print the path of the file that would be modified,
as well as the change made to the file.
as well as the change made to the file.
"""
with open(path, 'rt') as fin:
original_text = fin.read().replace('\r\n','\n')
@ -51,7 +51,7 @@ def update_license_in_source_directories(source_dirs, dry_run, show_diff):
dry_run: if True, just print the path of the file that would be updated,
but don't change it.
show_diff: if True, print the path of the file that would be modified,
as well as the change made to the file.
as well as the change made to the file.
"""
from devtools import antglob
prune_dirs = antglob.prune_dirs + 'scons-local* ./build* ./libs ./dist'

View File

@ -46,7 +46,7 @@ def do_subst_in_file(targetfile, sourcefile, dict):
with open(sourcefile, 'r') as f:
contents = f.read()
for (k,v) in list(dict.items()):
v = v.replace('\\','\\\\')
v = v.replace('\\','\\\\')
contents = re.sub(k, v, contents)
with open(targetfile, 'w') as f:
f.write(contents)
@ -158,7 +158,7 @@ def main():
Generates doxygen documentation in build/doxygen.
Optionally makes a tarball of the documentation to dist/.
Must be started in the project top directory.
Must be started in the project top directory.
"""
from optparse import OptionParser
parser = OptionParser(usage=usage)

View File

@ -1,8 +1,8 @@
***NOTE***
***NOTE***
If you get linker errors about undefined references to symbols that involve types in the `std::__cxx11` namespace or the tag
`[abi:cxx11]` then it probably indicates that you are trying to link together object files that were compiled with different
values for the _GLIBCXX_USE_CXX11_ABI marco. This commonly happens when linking to a third-party library that was compiled with
values for the _GLIBCXX_USE_CXX11_ABI marco. This commonly happens when linking to a third-party library that was compiled with
an older version of GCC. If the third-party library cannot be rebuilt with the new ABI, then you need to recompile your code with
the old ABI,just like:
**g++ stringWrite.cpp -ljsoncpp -std=c++11 -D_GLIBCXX_USE_CXX11_ABI=0 -o stringWrite**

View File

@ -1,4 +1,4 @@
[ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
[ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
"ccccccccccccccccccccccc",
"dddddddddddddddddddddddddddddddddddddddddddddddddddd" ]

View File

@ -1,17 +1,17 @@
{
{
"count" : 1234,
"name" : { "aka" : "T.E.S.T.", "id" : 123987 },
"attribute" : [
"random",
"short",
"bold",
12,
{ "height" : 7, "width" : 64 }
"attribute" : [
"random",
"short",
"bold",
12,
{ "height" : 7, "width" : 64 }
],
"test": { "1" :
{ "2" :
{ "3" : { "coord" : [ 1,2] }
}
"test": { "1" :
{ "2" :
{ "3" : { "coord" : [ 1,2] }
}
}
}
}

View File

@ -1,4 +1,4 @@
{
{
"count" : 1234,
"name" : "test",
"attribute" : "random"

View File

@ -1,3 +1,3 @@
{
{
"" : 1234
}

View File

@ -6,6 +6,6 @@
/* Comment before 'second'
*/
.second=2
/* A comment at
/* A comment at
the end of the file.
*/

View File

@ -9,6 +9,6 @@
"second" : 2
}
/* A comment at
/* A comment at
the end of the file.
*/

View File

@ -15,7 +15,7 @@ import types
if len(sys.argv) != 2:
print("Usage: %s input-json-file", sys.argv[0])
sys.exit(3)
input_path = sys.argv[1]
base_path = os.path.splitext(input_path)[0]
actual_path = base_path + '.actual'
@ -23,7 +23,7 @@ rewrite_path = base_path + '.rewrite'
rewrite_actual_path = base_path + '.actual-rewrite'
def valueTreeToString(fout, value, path = '.'):
ty = type(value)
ty = type(value)
if ty is types.DictType:
fout.write('%s={}\n' % path)
suffix = path[-1] != '.' and '.' or ''
@ -49,7 +49,7 @@ def valueTreeToString(fout, value, path = '.'):
fout.write('%s=null\n' % path)
else:
assert False and "Unexpected value type"
def parseAndSaveValueTree(input, actual_path):
root = json.loads(input)
fout = file(actual_path, 'wt')
@ -62,7 +62,7 @@ def rewriteValueTree(value, rewrite_path):
#rewrite = rewrite[1:-1] # Somehow the string is quoted ! jsonpy bug ?
file(rewrite_path, 'wt').write(rewrite + '\n')
return rewrite
input = file(input_path, 'rt').read()
root = parseAndSaveValueTree(input, actual_path)
rewrite = rewriteValueTree(json.write(root), rewrite_path)