Skip to content

[red-knot] Explore alternative notation for declaring file names in mdtests #15695

@MichaReiser

Description

@MichaReiser

Description

Our mdtest framework allows multifile tests. The file's path is declared as an attribute in the code snippet:

```pyi path=/typeshed/stdlib/builtins.pyi
class Custom: ...

custom_builtin: Custom
```

The downside of this is that the paths arent visible when rendering the markdown file on Github, which makes it harder to understand the test.

Image

We should explore if there are other notations for specifying a file's path that is visible when rendered on GitHub. We probably want to support both notations (the old and new one) for now to avoid having to rewrite all tests.

E.g. we could use a bold text right before a code snippet as the file path.

**/typeshed/stdlib/builtins.pyi**

```pyi
class Custom: ...

custom_builtin: Custom
```

The ideal solution would be if we can get GitHub to render the file's attributes because even the information that it is a pyi file is relevant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedContributions especially welcometestingRelated to testing Ruff itselftyMulti-file analysis & type inference

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions