1
0
Fork 0

Merging upstream version 5.0.0+dfsg.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-09 20:24:12 +01:00
parent 894e74df77
commit e531b1b230
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
12 changed files with 153 additions and 26 deletions

View file

@ -82,6 +82,24 @@ def test_autofix_main(tmpdir):
assert ret == 0
def test_invalid_main(tmpdir):
srcfile1 = tmpdir.join('not_valid_json.json')
srcfile1.write(
'{\n'
' // not json\n'
' "a": "b"\n'
'}',
)
srcfile2 = tmpdir.join('to_be_json_formatted.json')
srcfile2.write('{ "a": "b" }')
# it should have skipped the first file and formatted the second one
assert main(['--autofix', str(srcfile1), str(srcfile2)]) == 1
# confirm second file was formatted (shouldn't trigger linter again)
assert main([str(srcfile2)]) == 0
def test_orderfile_get_pretty_format():
ret = main((
'--top-keys=alist', get_resource_path('pretty_formatted_json.json'),