Skip to content

Use CI to make sure # doctest: +ELLIPSIS is not in docs #17019

Closed

Description

@thomasjpfan

Following from #16992

Activity

  1. GaelVaroquaux commented on Apr 24, 2020

    @GaelVaroquaux
    Member

    cc @lucyleeow if you have spare cycles

  2. lucyleeow commented on Apr 24, 2020

    @lucyleeow
    Member

    AFAICT there is no option to do this with flake8. You could do it with a flake8 plugin (e.g., https://github.com/i02sopop/flake8-banned-words) but we'd need to rely on an external plugin.

    I could also use a grep function (e.g., grep --include=\*.py -rnw sklearn/ -e '# doctest: +ELLIPSIS'), capture the exit code and raise an error if pattern found.

  3. cmarmo commented on May 12, 2020

    @cmarmo
    Contributor

    @thomasjpfan @jnothman I'm quite sure a PR has just been merged removing a forgotten "# doctest: +NORMALIZE_WHITESPACE", but I can't find it right now. Anyway, finding this one (#13991) helped me to better understand what is the goal of this issue.
    Shouldn't be more suitable to check for custom doctest directive in the CI, not only ELLIPSIS?

  4. thomasjpfan commented on May 16, 2020

    @thomasjpfan
    MemberAuthor

    I could also use a grep function (e.g., grep --include=*.py -rnw sklearn/ -e '# doctest: +ELLIPSIS'), capture the exit code and raise an error if pattern found.

    We most likely need to check the rst as well.

    Shouldn't be more suitable to check for custom doctest directive in the CI, not only ELLIPSIS?

    I agree we should check for "# doctest: +NORMALIZE_WHITESPACE". I think a greping solution as suggested by @lucyleeow would work for our use case.

  5. rth commented on May 18, 2020

    @rth
    Member

    Ideally it would have been nice to run this as part of pre-commit checks as well, so that these checks could be easily run locally, but so far I have not found an obvious way of doing that. There is a number of setups that forbid something https://pre-commit.com/hooks.html but not one that takes as input a list of regexp...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions