Zum Inhalt springen

File name matches type (ARCH2005)

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

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.

helpers.py
class PaymentProcessor: # file name does not match the type
def charge(self, amount):
...
payment_processor.py
class PaymentProcessor:
def charge(self, amount):
...

Rename the file to the snake_case form of its primary type (e.g. PaymentProcessor → payment_processor.py).