Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds --no-magic flag #156

Closed
wants to merge 1 commit into from
Closed

Adds --no-magic flag #156

wants to merge 1 commit into from

Conversation

angerman
Copy link

@angerman angerman commented Apr 30, 2017

Under certain conditions you might want to sidestep the directory
expansion and auto argument discovery. --no-magic provides this.
External tools invoking doctest, and wishing full control over the
passed argument, might want to use --no-magic.

This should fix the first part of #155.

Under certain conditions you might want to sidestep the directory
expansion and auto argument discovery.  --no-magic provides this.
External tools invoking doctest, and wishing full control over the
passed argument, might want to use --no-magic.

This should fix the first part of sol#155.
@angerman
Copy link
Author

angerman commented May 1, 2017

Can we get this with a version bump to 0.12? I'd adjust the corresponding cabal PR, to verify that doctest is 0.12 or later.

@sol
Copy link
Owner

sol commented May 4, 2017

@angerman first things first, thanks for looking into cabal doctest!

Now the straight talk, this code has issues, it

  1. has no tests

  2. is not well factored

  3. is not correct, e.g. try

    ghci> stripNoMagic ["--no-magic"]
    (False,["--no-magic"])
    

    or

    ghci> stripNoMagic ["--no-magic", "--no-magic", "--foo"]
    (True,["--no-magic","--foo"])
    

I consider (2) and (3) symptoms of (1).

Regarding (2), the existing code is already quite spaghetti, so this may be broken window theory at work. But given this situation it is even more important that we don't make it any worse.

What I now did is: Instead of reviewing your code, I refactored the code and added --no-magic and --info myself (see #159).

Except for the unit tests, my code is untested (that is I did not try it manually).

Can you chime in and

I'm closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants