From 43d6aa9173fdb0beb649a06383d4c05fe042e543 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Mon, 8 May 2023 18:24:53 -0400 Subject: [PATCH] Clarify some docstring-related docs (#4292) --- docs/faq.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/faq.md b/docs/faq.md index 4cb6e3c8fa..1e446b4422 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -267,7 +267,7 @@ Found 3 errors. ## Does Ruff support NumPy- or Google-style docstrings? -Yes! To enable specific docstring convention, add the following to your `pyproject.toml`: +Yes! To enforce a docstring convention, add the following to your `pyproject.toml`: ```toml [tool.ruff.pydocstyle] @@ -278,7 +278,8 @@ For example, if you're coming from flake8-docstrings, and your originating confi `--docstring-convention=numpy`, you'd instead set `convention = "numpy"` in your `pyproject.toml`, as above. -Alongside `convention`, you'll want to explicitly enable the `D` rule code prefix, like so: +Alongside `convention`, you'll want to explicitly enable the `D` rule code prefix, since the `D` +rules are not enabled by default: ```toml [tool.ruff] @@ -292,6 +293,8 @@ convention = "google" Setting a `convention` force-disables any rules that are incompatible with that convention, no matter how they're provided, which avoids accidental incompatibilities and simplifies configuration. +By default, no `convention` is set, and so the enabled rules are determined by the `select` setting +alone. ## How can I tell what settings Ruff is using to check my code?