-
Notifications
You must be signed in to change notification settings - Fork 444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor add_cpplint_files and add_clang_format files to support downstream projects, large file numbers. #3762
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes in add_cpplint_files - LGTM.
fb1324d
to
9e789e6
Compare
9e789e6
to
8981b13
Compare
5012b1e
to
d8db73d
Compare
CMakeLists.txt
Outdated
# Pipe the file into cpplint. | ||
add_custom_target( | ||
cpplint | ||
COMMAND cat ${CPPLINT_FILE} | xargs -n 10000000 ${CPPLINT_CMD} ${CPPLINT_ARGS} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need '-n 10000000'?
d6fa305
to
eb37a3b
Compare
CMakeLists.txt
Outdated
COMMAND ${CPPLINT_CMD} ${CPPLINT_ARGS} ${CPPLINT_FILES} | ||
# Replace the semicolon-separators with space separators. | ||
string(REPLACE ";" " " CPPLINT_FILES "${CPPLINT_FILES}") | ||
# Write the list to a file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would mention why need this workaround as me reach sh limitation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And probably you do not need this if you use xargs -d ';'
@@ -49,7 +49,8 @@ macro (p4c_add_library name symbol var) | |||
endmacro(p4c_add_library) | |||
|
|||
# Add files with the appropriate path to the list of linted files | |||
function(add_cpplint_files dir filelist) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably some warning comment is needed that these macros could be used by downstream projects so it is important to leave them as macros, etc..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that we are adding cpplint files to a global property this might actually not be necessary any longer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
Also please adjust patch title and description as this PR now fixes and touches more things. Thanks for fixing this issue! |
I will try it on our side again to ensure everything is fine. |
Okay, go ahead :) |
The linters were unable to support large lists of files because of a Make/Unix limitation.
This PR does two things.