-
Notifications
You must be signed in to change notification settings - Fork 2k
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
dist tools: header guard checker #6438
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/sh | ||
|
||
# Copyright 2017 Oliver Hahm <oliver.hahm@inria.fr> | ||
# | ||
# This file is subject to the terms and conditions of the GNU Lesser | ||
# General Public License v2.1. See the file LICENSE in the top level | ||
# directory for more details. | ||
|
||
# customizable | ||
DIRS="core drivers pkg sys" | ||
|
||
# prepare | ||
EXIT_CODE=0 | ||
|
||
# check files | ||
if FILES=$(git grep -lE 'ifndef\ +(_.*_H$|.*_H_$)' ${DIRS}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
What's the advantage?
My assessment was exactly the opposite. Too much cluttered information for my taste. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Avoiding weird false-positives like e.g. const struct someweirdtypenameifndef _MY_PRIVATE_CONSTANT_FOR_HEIGHT_H
I'm already annoyed about the doc-checker, that tells me there is a problem in file x, but not what the problem is ;-) |
||
then | ||
EXIT_CODE=1 | ||
for LINE in ${FILES} | ||
do | ||
echo "files with invalid header guard (leading or trailing underscore): ${LINE}" | ||
done | ||
fi | ||
|
||
exit ${EXIT_CODE} |
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 not
boards
? If we do the proposedvendor/
include structure, we might also be able to addcpu
.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.
True. I saw some warnings and thought they were vendor specific, but actually they can and should be fixed. Will update.