Skip to content

Line filtering error on large patches #10

Closed
@justinboneh

Description

@justinboneh

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions