Improve type specifications and documentation

- Added missing type specifications for Hello function and rules - Updated documentation for the Deserialize protocol -
Cleaned up IBAN validation function documentation - Enhanced test fixture generation with clearer parsing and error
messages
This commit is contained in:
2025-12-02 11:14:40 -05:00
parent 71aa8cfde6
commit 492cb2378e
9 changed files with 41 additions and 43 deletions

View File

@@ -101,7 +101,7 @@ defp size(iban) do
|> String.length()
end
# - Check whether a given IBAN violates the required format.
@doc "Check whether a given IBAN violates the required format."
@spec iban_violates_format?(String.t() | nil) :: boolean
def iban_violates_format?(nil), do: true
@@ -119,21 +119,21 @@ def iban_violates_format?(iban) when is_binary(iban) do
has_invalid_chars or country_code_lowercase
end
# - Check whether a given IBAN violates the required format in bank_code.
@doc "Check whether a given IBAN violates the required format in bank_code."
@spec iban_violates_bank_code_format?(binary()) :: boolean
def iban_violates_bank_code_format?(iban), do: iban_violates_bban_part_format?(iban, :bank_code)
# - Check whether a given IBAN violates the required format in branch_code.
@doc "Check whether a given IBAN violates the required format in branch_code."
@spec iban_violates_branch_code_format?(binary()) :: boolean
def iban_violates_branch_code_format?(iban),
do: iban_violates_bban_part_format?(iban, :branch_code)
# - Check whether a given IBAN violates the required format in account_number.
@doc "Check whether a given IBAN violates the required format in account_number."
@spec iban_violates_account_number_format?(binary()) :: boolean
def iban_violates_account_number_format?(iban),
do: iban_violates_bban_part_format?(iban, :account_number)
# - Check whether a given IBAN violates the required format in national_check.
@doc "Check whether a given IBAN violates the required format in national_check."
@spec iban_violates_national_check_format?(binary()) :: boolean
def iban_violates_national_check_format?(iban),
do: iban_violates_bban_part_format?(iban, :national_check)
@@ -150,7 +150,7 @@ defp iban_violates_bban_part_format?(iban, part) do
end
end
# - Check whether a given IBAN violates the supported countries.
@doc "Check whether a given IBAN violates the supported countries."
@spec iban_unsupported_country?(String.t()) :: boolean
def iban_unsupported_country?(iban) do
supported? =