Skip to content

Commit c60b0e0

Browse files
pqkwalrath
authored andcommitted
fix syntax in lint excludes (#1715)
1 parent bda1970 commit c60b0e0

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/_guides/language/analysis-options.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -240,14 +240,15 @@ include: package:pedantic/analysis_options.yaml
240240
linter:
241241
rules:
242242
avoid_shadowing_type_parameters: false
243-
- await_only_futures
243+
await_only_futures: true
244244
{% endprettify %}
245245

246-
<aside class="alert alert-info" markdown="1">
247-
The reason you don't include an initial dash (`- `)
248-
when you specify a value (`: false`) is that
249-
the YAML syntax for key-value maps is slightly different
250-
from the YAML syntax for lists.
246+
<aside class="alert alert-warning” markdown="1">
247+
If you disable any rules, then use key-value syntax to enable rules.
248+
For example, the preceding example can’t use `- await_only_futures`;
249+
instead, it must use `await_only_futures: true`.
250+
The reason it can’t use the dash shortcut (`-`) to enable `await_only_futures`
251+
is that YAML doesn't support mixing list and key-value syntaxes.
251252
</aside>
252253

253254
## Excluding code from analysis

0 commit comments

Comments
 (0)