Incorrect finance Validation Logic (possible bug)
Hi,
while reviewing the finance.py validators (ISIN, CUSIP, SEDOL), I found that the validators contain several issues, and I’d like to confirm whether this is a bug or if I’m missing something.
Reference to my mutation-testing analysis:
Bolest-oci/mutation-testing#35
F.e ISIN
The official ISIN format is two uppercase letters, nine alphanumeric characters, and one check digit (12 characters total).
However, the current validator seems incomplete:
- The Luhn checksum is implemented incorrectly and never computed.
- The format is not enforced (first two characters should be uppercase letters, last must be a digit).
- Lowercase letters and invalid characters are accepted.
- It does not verify that the first two letters form a country code (optional, but usually expected).
I'm thinking of submitting a PR with a fix, but I'm asking first to make sure I'm not missing something.
Thanks!
Reactions are currently unavailable
Incorrect finance Validation Logic (possible bug)
Hi,
while reviewing the finance.py validators (ISIN, CUSIP, SEDOL), I found that the validators contain several issues, and I’d like to confirm whether this is a bug or if I’m missing something.
Reference to my mutation-testing analysis:
Bolest-oci/mutation-testing#35
F.e ISIN
The official ISIN format is two uppercase letters, nine alphanumeric characters, and one check digit (12 characters total).
However, the current validator seems incomplete:
I'm thinking of submitting a PR with a fix, but I'm asking first to make sure I'm not missing something.
Thanks!