[SERVER-54475] cpplint SSPL check dies of Python exception on very short files Created: 11/Feb/21  Updated: 29/Oct/23  Resolved: 12/Feb/21

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 4.9.0

Type: Bug Priority: Major - P3
Reporter: Billy Donahue Assignee: Billy Donahue
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-71738 Move license_header lint to clang-tidy Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Service Arch 2021-02-22
Participants:

 Description   

I'm seeing ninja lint fail on the new 3-line "shim" files because they are so short that the license check is accessing an element past the end of the lines List. That can be "fixed" a few ways:

including the license in those trivial comment only shim files.

skipping the check for short files

continuing to check them, but check the length first so they merely fail the check.

Proposed fix:

https://github.com/mongodb/mongo/compare/master...BillyDonahue:lint_crash

-If something is less than 3 lines long, skip the SSPL disclaimer check.-
Add the license everywhere.

 

Side fix: when the linter throws, we should report the filename that failed regardless.



 Comments   
Comment by Githook User [ 12/Feb/21 ]

Author:

{'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}

Message: SERVER-54475 Add SSPL to shim files. Refactor sspl check.

simplecpplint.py
Improve license check
Clearer exception handling
Fix process exit code (success:0, lintFail:1, internalError:2)

Add '-present' year range suffix to copyright notice in a few c++ files.
Branch: master
https://github.com/mongodb/mongo/commit/c8a02bacb3c3fa1a530669af7373603896f336d0

Comment by Billy Donahue [ 12/Feb/21 ]

CR https://mongodbcr.appspot.com/731700035

Comment by Andrew Morrow (Inactive) [ 11/Feb/21 ]

We should first fix the linter to not crash and give a good message on these files, and then add the SSPL to the files it flags.

Generated at Thu Feb 08 05:33:38 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.