-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
check_names: extend typo check to PSA macro/enum names #6558
Conversation
Typos of PSA macro and enum names are not checked by check_names.py. This commit extend the check list to include PSA_XXX references. The words should be macro/enum names defined as public_macros, internal_macros, private_macros and enums. This commit alse extend the scope of enums to include those are defined in library/*.c. A new type of macros "private", which are defined in library/*.c was also added. Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
This macro is expected to be defined out of the library, and there is no definition in the library. Thus it needs to be excluded from typo check. Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
Fix the PSA_XXX typos detected by check_names.py. PSA_WANT is actually not typo, but would cause a false negative result. So PSA_WANT is reworded to PSA_WANT_xxx. Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
The PSA_CRYPTO_C is excluded from typo check for the following false negative report: ``` > include/mbedtls/check_config.h:329: 'PSA_CRYPTO_C' looks like a typo. It was not found in any macros or any enums. If this is not a typo, put //no- check-names after it. | 329 | * Note: ECJPAKE_C depends on MD_C || PSA_CRYPTO_C. */ | ^^^^^^^^^^^^ ``` Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
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.
LGTM
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.
LGTM
tests/scripts/check_names.py
Outdated
r"MBEDTLS_TEST_LIBTESTDRIVER*") | ||
r"MBEDTLS_TEST_LIBTESTDRIVER*|" | ||
r"PSA_CRYPTO_DRIVER_TEST|" | ||
r"PSA_CRYPTO_C") |
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.
PSA_CRYPTO_C
is not needed here. There's only one place that uses it in comment in check_config.h
and it can be easily fixed.
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 know you are referring to
mbedtls/include/mbedtls/check_config.h
Line 330 in 531a871
* Note: ECJPAKE_C depends on MD_C || PSA_CRYPTO_C. */ |
I think it might not be a typo. The
MBEDTLS_
prefix is omitted from the macro names not only in PSA_CRYPTO_C
, but also in ECJPAKE_C
and MD_C
. I would like to keep the exclusion here OR add the MBEDTLS_
back for all these three macro names. What's you suggestion?
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.
Not really a typo, just a decision to shorten the names to keep it compact :)
Compliance-(or typo-)checking scripts should have priority over such simplification in comments, so I would suggest either:
- Only changing
MBEDTLS_PSA_CRYPTO_C
to keep the script happy (it's fine, these are just comments); - Changing all of these to full macro names to be consistent.
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.
One improvement requested that will also help keep this script in line with the backport.
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
3bb0e43
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.
LGTM
Description
This PR extends typo checks of
check_names.py
to include PSA macro/enum names.Resolve: #6416
Status
READY
Todos
check_names.py
to check typos of PSA macro/enum names