diff --git a/docs/docs/writing-plugins/common-subsystem-tasks.mdx b/docs/docs/writing-plugins/common-subsystem-tasks.mdx index d5bafb9fd73..70490d9ae3d 100644 --- a/docs/docs/writing-plugins/common-subsystem-tasks.mdx +++ b/docs/docs/writing-plugins/common-subsystem-tasks.mdx @@ -54,25 +54,27 @@ class FortranLintFieldSet(FieldSet): :::note Support depends on language backend of the subsystem Only some language backends support `pants export`. These include the Python and JVM backends. Only tools which are themselves written to use a backend with this feature can be exported. For example, a Python-based tool which operates on a different language is exportable. - +::: 1. Make the subsystem a subclass of `ExportableTool` -:::note Language backends may have done this in their Tool base class. For example, the Python backend with `PythonToolRequirementsBase` and JVM with `JvmToolBase` are already subclasses. + :::note Language backends may have done this in their Tool base class. + For example, the Python backend with `PythonToolRequirementsBase` and JVM with `JvmToolBase` are already subclasses. + ::: -```python -from pants.backend.python.subsystems.python_tool_base import PythonToolBase -from pants.core.goals.resolves import ExportableTool + ```python + from pants.backend.python.subsystems.python_tool_base import PythonToolBase + from pants.core.goals.resolves import ExportableTool -class FortranLint(PythonToolBase, ExportableTool): - ... -``` + class FortranLint(PythonToolBase, ExportableTool): + ... + ``` 2. Register your class with a `UnionRule` with `ExportableTool` -```python -def rules(): - return [ - UnionRule(ExportableTool, FortranLint) - ] -``` + ```python + def rules(): + return [ + UnionRule(ExportableTool, FortranLint) + ] + ```