Skip to content
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

[ci] added cpplint check #2416

Merged
merged 3 commits into from
Sep 19, 2019
Merged

[ci] added cpplint check #2416

merged 3 commits into from
Sep 19, 2019

Conversation

StrikerRUS
Copy link
Collaborator

Refer to #1990, #2407 (comment).

Copy link
Collaborator

@jameslamb jameslamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made two suggestions which are effectively style things, but otherwise I love this idea. I'll be adding an R linter soon!

.ci/test.sh Outdated
conda install -q -y -n $CONDA_ENV pycodestyle pydocstyle
pip install --user cpplint
cpplint --filter=-build/header_guard,-whitespace/line_length --recursive ./src ./include || exit 0 # TODO: change to -1 after fixing #1990
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@StrikerRUS I'm a fan of never putting TODOs in code, but instead keeping such details in the issues. In this case, you could just add that comment to #1990 if you haven't already.

Also I'm a fan of having commands with more than one argument indented like below, so their git blames are cleaner and so that it's more obvious what they are doing:

cpplint \
    --filter=-build/header_guard,-whitespace/line_length \
    --recursive \
    ./src \
    ./include \
|| exit 0

Up to you on both of these!

Copy link
Collaborator Author

@StrikerRUS StrikerRUS Sep 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jameslamb Thanks for your review!
Agree with your first comment. Will remove TODO from the code.

Also, agree with your second comment, but I'm a fan of having consistent state, even if it's not perfect 😃 . I mean, we have a lot of such commands with plenty of args in this (and neighboring) file and this line will be "rara avis" here. So, I think such style improvements should be done at once in a separate PR instead of iterative one-line corrections.

I'll be adding an R linter soon!

Nice to hear!

@StrikerRUS
Copy link
Collaborator Author

I just changed the order of checks in the latest commit 984d15b with the aim to prevent fast exit due to temporary || exit 0 and allow pylint take effect.

@StrikerRUS StrikerRUS merged commit 306c6db into master Sep 19, 2019
@StrikerRUS StrikerRUS deleted the cpplint branch September 19, 2019 13:49
@lock lock bot locked as resolved and limited conversation to collaborators Mar 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants