Make check_names.py repo-specific #186

Open
opened 2025-07-16 10:23:20 -05:00 by davidhorstmann-arm · 1 comment
davidhorstmann-arm commented 2025-07-16 10:23:20 -05:00 (Migrated from github.com)

At present check_names.py uses a single set of regex for allowed names in all repositories. As the repositories diverge, check_names.py should distinguish between the repos and perform different name checks for each.

Currently we would like the prefix TF_PSA_CRYPTO_ and tf_psa_crypto_ to be allowed only in the TF-PSA-Crypto repository (not in Mbed TLS). In future we may want to do other things (e.g. disallowing definitions that start with psa_ in Mbed TLS.

Definition of Done:

  • check_names.py only allows TF-PSA-Crypto prefixes in the TF-PSA-Crypto repo.
  • The script is refactored so as to allow other repo-specific rules to be easily added.
At present `check_names.py` uses a single set of regex for allowed names in all repositories. As the repositories diverge, `check_names.py` should distinguish between the repos and perform different name checks for each. Currently we would like the prefix `TF_PSA_CRYPTO_` and `tf_psa_crypto_` to be allowed only in the TF-PSA-Crypto repository (not in Mbed TLS). In future we may want to do other things (e.g. disallowing definitions that start with `psa_` in Mbed TLS. Definition of Done: * `check_names.py` only allows TF-PSA-Crypto prefixes in the TF-PSA-Crypto repo. * The script is refactored so as to allow other repo-specific rules to be easily added.
gilles-peskine-arm commented 2025-07-16 10:33:12 -05:00 (Migrated from github.com)

“What's the expected prefix for identifiers in this project?” and “what are the subprojects of this project (and their identifier prefix)?” are questions I've also faced in https://github.com/Mbed-TLS/mbedtls-framework/pull/164. There, each repository defines a data structure with a prefix project_cpp_prefix.

Conceptually, this feels like the sort of thing that could be defined once per project. It would be a generalization of scripts/project_name.txt. Maybe a scripts/project_data.json?

But given that we only have two projects, and only a very small number of pieces of knowledge about each project, doing this in a structured way is probably overkill.

“What's the expected prefix for identifiers in this project?” and “what are the subprojects of this project (and their identifier prefix)?” are questions I've also faced in https://github.com/Mbed-TLS/mbedtls-framework/pull/164. There, each repository defines a data structure with a prefix `project_cpp_prefix`. Conceptually, this feels like the sort of thing that could be defined once per project. It would be a generalization of `scripts/project_name.txt`. Maybe a `scripts/project_data.json`? But given that we only have two projects, and only a very small number of pieces of knowledge about each project, doing this in a structured way is probably overkill.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-Mbed-TLS/mbedtls-framework#186
No description provided.