Shared coding conventions allow teams to collaborate efficiently. This rule checks that all keys match a provided regular expression.
As Java properties files are used in a large variety of ways and by many frameworks, it might sometimes be tricky to enforce a strict key naming convention. However, the default regular expression has been designed to match as closely as possible the following guidelines:
bank-account-number=123456 # Noncompliant bank_account_owner=John Doe # Noncompliant
bank.account.number=123456 bank.account.owner=John Doeto
bankAccountNumber=123456 bankAccountOwner=John Doe
bank.account.number=123456 bank.account.owner=John Doeto
Bank.Account.Number=123456 Bank.Account.Owner=John DoeBut keep it readable. For example, prefer:
font.timesNewRoman.size=10to
font.timesnewroman.size=10