diff --git a/docs/conf.py b/docs/conf.py index 5a358b9..c56a255 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -96,6 +96,7 @@ ## myst_parser myst_parser_config = {"myst_enable_extensions": ["rst_eval_roles"]} +nitpick_ignore = [("myst", "group-rules")] ## numpydoc numpydoc_class_members_toctree = False diff --git a/docs/guides/faq.md b/docs/guides/faq.md index 74ce376..5807525 100644 --- a/docs/guides/faq.md +++ b/docs/guides/faq.md @@ -32,17 +32,4 @@ class UserSchema(dy.Schema): ## How do I fix the ruff error `First argument of a method should be named self`? -If you are using [`ruff`](https://docs.astral.sh/ruff/) and introduce custom rules for your schemas, `ruff` will create -the following linting error: - -``` -N805 First argument of a method should be named `self` -``` - -To fix this, you'll need to let `ruff` know that the `@dy.rule` decorator is applied to classmethods. This can easily -be done by adding the following to your `pyproject.toml`: - -```toml -[tool.ruff.lint.pep8-naming] -classmethod-decorators = ["dataframely.rule"] -``` +See our documentation on [group rules](./quickstart.md#group-rules). diff --git a/docs/guides/quickstart.md b/docs/guides/quickstart.md index 388f58b..c6216b9 100644 --- a/docs/guides/quickstart.md +++ b/docs/guides/quickstart.md @@ -95,12 +95,11 @@ in order to produce exactly one value per group: in group rules, the "input" that the expression is evaluated on is a set of rows. ````{note} -If you are using `mypy` to type check your code, the usage of rules requires you to use the dataframely `mypy` plugin. -In order to use it, add the following to your `pyproject.toml`: +If you are using [`ruff`](https://docs.astral.sh/ruff/) to lint your code, you'll need to tell `ruff` to treat rules like classmethods. To this end, you can add the following to your `pyproject.toml`: ```toml - [tool.mypy] - plugins = ["dataframely.mypy"] +[tool.ruff.lint.pep8-naming] +classmethod-decorators = ["dataframely.rule"] ``` ```` diff --git a/pyproject.toml b/pyproject.toml index 121b026..662e06d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -116,4 +116,4 @@ markers = [ testpaths = ["tests"] [tool.coverage.run] -omit = ["dataframely/mypy.py", "dataframely/testing/generate.py"] +omit = ["dataframely/testing/generate.py"]