Skip to content

Adds --no-magic flag - #156

Closed
angerman wants to merge 1 commit into
sol:masterfrom
zw3rk:master
Closed

angerman wants to merge 1 commit into
sol:masterfrom
zw3rk:master

Conversation

@angerman

@angerman angerman commented Apr 30, 2017 •

Copy link
Copy Markdown

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

angerman commented May 1, 2017

Copy link
Copy Markdown
Author

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

sol commented May 4, 2017

Copy link
Copy Markdown
Owner

@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