-
Notifications
You must be signed in to change notification settings - Fork 3k
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
travis: Add include_check job #9286
travis: Add include_check job #9286
Conversation
.travis.yml
Outdated
- NAME=include_check | ||
script: | ||
- echo 'Checking that there are no '#include "mbed.h"' in code where it should not be' | ||
- ! git grep '^#include "mbed.h"$' -- '*.c' '*.h' '*.cpp' '*.hpp' ':!*platform_mbed.h' ':!*TESTS/*' ':!TEST_APPS/' ':!UNITTESTS/' ':!*tests/*' ':!*targets/*' ':!*TARGET_*' ':!*unsupported/*' |
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.
why is targets
folder also excluded?
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.
According to @AnttiKauppila: targets folder is excluded for now because it has not been fixed as of yet.
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 checked and there are 5 #mbed.h" includes under targets/. Maybe we should raise minor defects out of those. I want that corresponding teams fixes those because testing changes can be difficult.
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.
That explains it, lets create issues for these and will be fixed
@alekla01, thank you for your changes. |
.travis.yml
Outdated
- NAME=include_check | ||
script: | ||
- echo 'Checking that there are no '#include "mbed.h"' in code where it should not be' | ||
- ! git grep '^#include "mbed.h"$' -- '*.c' '*.h' '*.cpp' '*.hpp' ':!*platform_mbed.h' ':!*TESTS/*' ':!TEST_APPS/' ':!UNITTESTS/' ':!*tests/*' ':!*targets/*' ':!*TARGET_*' ':!*unsupported/*' |
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.
@0xc0170 Could you confirm that astyle settings will guarantee that ^#include "mbed.h"$
is sufficient for matching?
Otherwise, @alekla01 might need to make this search a bit more generic, maybe something like the following:
- ! git grep '^#include "mbed.h"$' -- '*.c' '*.h' '*.cpp' '*.hpp' ':!*platform_mbed.h' ':!*TESTS/*' ':!TEST_APPS/' ':!UNITTESTS/' ':!*tests/*' ':!*targets/*' ':!*TARGET_*' ':!*unsupported/*' | |
- ! git grep '^#include.*mbed.h["']$' -- '*.c' '*.h' '*.cpp' '*.hpp' ':!*platform_mbed.h' ':!*TESTS/*' ':!TEST_APPS/' ':!UNITTESTS/' ':!*tests/*' ':!*targets/*' ':!*TARGET_*' ':!*unsupported/*' |
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.
@0xc0170 Could you confirm that astyle settings will guarantee that ^#include "mbed.h"$ is sufficient for matching?
I don't think it formats this. Thus between include and mbed should be "any space"
CI started |
This PR needs a rebase before we can retest it. |
2032e84
to
6dfe03f
Compare
@alekla01 Before this goes to CI, can you squash these 5 commits into one: |
c9fcb4d
to
8c437c7
Compare
8c437c7
to
fc41ea9
Compare
CI started |
Description
MBEDOSTEST-421
check for
#include "mbed.h"
.#include "mbed.h"
should not be used in header and source files.Pull request type
Reviewers
@AnttiKauppila