Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix markdown syntax in "Making subsystems exportable ..." docs #20902

Merged
merged 2 commits into from
May 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions docs/docs/writing-plugins/common-subsystem-tasks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
]
```
Loading