Description
KeyError: 'line_filter'
when running with lines-changed-only: true
.
It fails on a file with 4288 line additions, so the file object is returned with no "patch" field.
{
"sha": "a6af39f8ae9809a353b26af5f1f2909a76cda742",
"filename": "xxxxxxxxxx.cpp",
"status": "added",
"additions": 4288,
"deletions": 0,
"changes": 4288,
"blob_url": "xxx",
"raw_url": "xxx",
"contents_url": "xxx"
}
From the log:
2022-09-13T13:08:09.8017447Z Traceback (most recent call last):
2022-09-13T13:08:09.8018099Z File "/home/runner/.local/bin/cpp-linter", line 8, in
2022-09-13T13:08:09.8018358Z sys.exit(main())
2022-09-13T13:08:09.8018791Z File "/home/runner/.local/lib/python3.8/site-packages/cpp_linter/run.py", line 1007, in main
2022-09-13T13:08:09.8019111Z capture_clang_tools_output(
2022-09-13T13:08:09.8019617Z File "/home/runner/.local/lib/python3.8/site-packages/cpp_linter/run.py", line 697, in capture_clang_tools_output
2022-09-13T13:08:09.8020009Z run_clang_format(filename, file, version, style, lines_changed_only)
2022-09-13T13:08:09.8020518Z File "/home/runner/.local/lib/python3.8/site-packages/cpp_linter/run.py", line 595, in run_clang_format
2022-09-13T13:08:09.8020878Z for line_range in file_obj["line_filter"][ranges]:
2022-09-13T13:08:09.8021162Z KeyError: 'line_filter'
2022-09-13T13:08:09.8314093Z ##[error]Process completed with exit code 1.