Skip to content

Fix the ruff include glob so example/ is actually linted - #75

Open
Danipulok wants to merge 1 commit into
pydantic:mainfrom
Danipulok:chore/ruff-include-example
Open

Fix the ruff include glob so example/ is actually linted#75
Danipulok wants to merge 1 commit into
pydantic:mainfrom
Danipulok:chore/ruff-include-example

Conversation

@Danipulok

Copy link
Copy Markdown
Contributor

What

Point the ruff include glob at example/, and add example/test_example.py to exclude.

Why

The glob names examples/, but the directory is example/, so it has never matched anything and the example package the suite runs against is not linted at all.

That file is the one thing under example/ that cannot be linted or formatted, because it is its own test data: find_examples parses its docstrings. docstring-code-format rewrites the #> print markers inside them to # >, and D212 would collapse the two docstring styles that test_python_self_change_docstyle exists to cover. It joins tests/cases_update/*.py in exclude, which already holds test data for the same reason.

How to test

make lint passes and leaves example/test_example.py untouched. Add any other .py file under example/ and ruff check now reports it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant