"""Tests for D420 (section order) with NumPy convention."""


def correct_order():
    """Summary.

    Extended Summary
    ----------------
    More details.

    Parameters
    ----------
    x : int
        Description.

    Attributes
    ----------
    attr : int

    Methods
    -------
    method

    Returns
    -------
    int

    Yields
    ------
    int

    Receives
    --------
    int

    Other Parameters
    ----------------
    y : int
        Description.

    Raises
    ------
    ValueError

    Warns
    -----
    UserWarning

    Warnings
    --------
    Be careful.

    See Also
    --------
    other_func

    Notes
    -----
    Some notes.

    References
    ----------
    [1] Reference.

    Examples
    --------
    >>> correct_order()
    """


def single_swap():
    """Summary.

    Notes
    -----
    Some notes.

    Returns
    -------
    int
    """


def multiple_out_of_order():
    """Summary.

    Examples
    --------
    >>> func()

    Returns
    -------
    int

    Notes
    -----
    Some notes.
    """


def single_section():
    """Summary.

    Returns
    -------
    int
    """


def notes_before_warns():
    """Summary.

    Notes
    -----
    Some notes.

    Warns
    -----
    UserWarning
    """


def other_params_alias():
    """Summary.

    Other Params
    ------------
    y : int
        Description.

    Parameters
    ----------
    x : int
        Description.
    """


def correct_partial():
    """Summary.

    Parameters
    ----------
    x : int
        Description.

    Returns
    -------
    int

    Examples
    --------
    >>> func()
    """


class CorrectClassDocstring:
    """Summary.

    Attributes
    ----------
    x : int
        Description.

    Methods
    -------
    do_something
    """


class WrongClassDocstring:
    """Summary.

    Methods
    -------
    do_something

    Attributes
    ----------
    x : int
        Description.
    """


def unrecognized_sections_only():
    """Summary.

    Custom Section
    --------------
    Some content.

    Another Custom
    --------------
    More content.
    """


def unrecognized_mixed_with_recognized():
    """Summary.

    Parameters
    ----------
    x : int
        Description.

    Custom Section
    --------------
    Some content.

    Returns
    -------
    int
    """


def _private_function_out_of_order():
    """Summary.

    Notes
    -----
    Some notes.

    Returns
    -------
    int
    """


def no_sections():
    """Summary.

    This is a docstring with no recognized sections at all.
    It just has some plain text that shouldn't trigger D420.
    """


def plain_text_with_section_like_words():
    """Summary.

    Returns the value of x. Notes that this is important.
    This should not be detected as having sections.
    """
