Skip to content
This repository was archived by the owner on Oct 2, 2020. It is now read-only.
This repository was archived by the owner on Oct 2, 2020. It is now read-only.

KLCRule subclasses have unhelpful docstrings #220

@Ratfink

Description

@Ratfink

Python classes and functions can have docstrings to describe their functionality. We currently have docstrings for most of the KLCRule subclasses, but these all say simply:

"""
Create the methods check and fix to use with the kicad lib files.
"""

This doesn't describe the rule at all! Really, that should be in a parent class' docstring, to describe how the parent is used.

Meanwhile, we have a description that we pass to the parent's constructor. That's documentation, but it's hidden in a place that's unexpected to Python developers.

I propose that we remove the description parameter to KLCRule and KLCRuleBase's constructors, and instead read the description as the first line of the class' docstring. This can be done as a property of KLCRuleBase, so the code to handle this can exist in exactly one place. Then our rule descriptions can live in an obvious place, and still get printed exactly as they do now, with minimal new code.

Are there any other thoughts on this? I'll be happy to implement this if other maintainers think it's a good idea.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions