{#

This is a jinja2 template for generating
a MarkDown description of a typeshed stubs package.
It works in conjunction with the
`typeshed_stats.serialize.stats_to_markdown()` function.

#}

{% if package_name == "stdlib" %}
{% set package_name = "the stdlib" %}
{% else %}
{% set package_name = "`{}`".format(package_name) %}
{% endif %}

## Info on typeshed's stubs for {{ package_name }}

{% if extra_description %}
### Extra description

{{ extra_description }}
{% endif %}

{% if upstream_url %}
### Upstream repo URL

[{{ upstream_url }}]({{ upstream_url }})
{% endif %}

{% if stub_distribution_name != "-" %}
### Stub distribution name

`{{ stub_distribution_name }}`
{% endif %}

### Number of lines

{{ number_of_lines }} (excluding blank lines)

### Package status: *{{ package_status.formatted_name }}*

{{ package_status.value }}

### Upload status: *{{ upload_status.formatted_name }}*

{{ upload_status.value }}

### Stubtest settings in CI: *{{ stubtest_strictness.formatted_name }}*

{{ stubtest_strictness.value }}

{% if not stubtest_is_skipped %}
{% set num_platforms = stubtest_platforms|length %}
{% if num_platforms == 1 %}
In CI, stubtest is run on `{{ stubtest_platforms[0] }}` only.
{% elif num_platforms == 2 %}
In CI, stubtest is run on `{{ stubtest_platforms[0] }}` and `{{ stubtest_platforms[1] }}`.
{% else %}
In CI, stubtest is run on `{{ stubtest_platforms[0] }}`, `{{ stubtest_platforms[1] }}` and `{{ stubtest_platforms[2] }}`.
{% endif %}
{% endif %}

{% if stubtest_allowlist_length == "0" %}
Typeshed currently has 0 allowlist entries for {{ package_name }} when running stubtest in CI.
{% elif stubtest_allowlist_length == "1" %}
Typeshed currently has 1 unique allowlist entry for {{ package_name }} when running stubtest in CI.
{% else %}
Typeshed currently has {{ stubtest_allowlist_length }} unique allowlist entries for {{ package_name }} when running stubtest in CI.
{% endif %}

### Pyright settings in CI: *{{ pyright_setting.formatted_name }}*

{{ pyright_setting.value }}

### Statistics on the annotations in typeshed's stubs for {{ package_name }}

- Parameters (excluding `self`, `cls`, `metacls` and `mcls`):
    - Annotated parameters: {{ annotated_parameters }}
    - Unannotated parameters: {{ unannotated_parameters }}
    - Explicit `Any` parameters: {{ explicit_Any_parameters }}
    - Explicitly `Incomplete` (or partially `Incomplete`) parameters: {{ explicit_Incomplete_parameters }}
- Returns:
    - Annotated returns: {{ annotated_returns }}
    - Unannotated returns: {{ unannotated_returns }}
    - Explicit `Any` returns: {{ explicit_Any_returns }}
    - Explicitly `Incomplete` (or partially `Incomplete`) returns: {{ explicit_Incomplete_returns }}
- Variables:
    - Annotated variables: {{ annotated_variables }}
    - Explicit `Any` variables: {{ explicit_Any_variables }}
    - Explicitly `Incomplete` (or partially `Incomplete`) variables: {{ explicit_Incomplete_variables }}
- Class definitions:
    - Total class definitions: {{ classdefs }}
    - Class definitions with `Any`: {{ classdefs_with_Any }}
    - Class definitions marked as at least partially `Incomplete`: {{ classdefs_with_Incomplete }}
