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

Ensure documentation examples are linted and formatted #1346

Open
StevenMaude opened this issue Jun 22, 2023 · 1 comment
Open

Ensure documentation examples are linted and formatted #1346

StevenMaude opened this issue Jun 22, 2023 · 1 comment
Labels
documentation Improvements or additions to documentation
Milestone

Comments

@StevenMaude
Copy link
Contributor

StevenMaude commented Jun 22, 2023

Depends on #1342, as it's simpler to do this for standalone files than code inside Markdown.

@StevenMaude StevenMaude added the documentation Improvements or additions to documentation label Jun 22, 2023
@StevenMaude
Copy link
Contributor Author

It doesn't really depend on #1342 really as there are ways of doing this already for inline code blocks. pytest-examples is one package that runs Ruff and Black against Markdown code blocks.

Ruff is maybe adding native support for formatting Markdown code blocks too.


Whether we'd actually want to do this is another question. Particularly formatting with Black which can lead to extra parentheses as it splits long lines.

One option might be to define our own Ruff and Black configuration — maybe only Ruff as that now formats too — for formatting dataset definitions, which might not exactly be the same as we use for the ehrQL source.

@inglesp inglesp added this to the P2 milestone Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
Status: No status
Development

No branches or pull requests

2 participants