File name matches type (ARCH2005)
Ce contenu n’est pas encore disponible dans votre langue.
Key python.naming.file-name-matches-type · Severity info · Category naming
When a source file’s name does not match its primary declared type, navigating the codebase becomes harder. The file name should be the snake_case form of the module’s main class.
Incorrect
Section titled “Incorrect”class PaymentProcessor: # file name does not match the type def charge(self, amount): ...Correct
Section titled “Correct”class PaymentProcessor: def charge(self, amount): ...Rename the file to the snake_case form of its primary type (e.g. PaymentProcessor → payment_processor.py).