These are chat archives for evhub/coconut

2nd
Oct 2017
Torben Hoffmann
@LeHoff_twitter
Oct 02 2017 04:58
Why does this fail on me?
match def update_score(score, Neither()) = score
@addpattern(update_score)
match def update_score(Result(h,a), Both()) = Result(h+1, a+1)
match def update_score(Result(h,a), Home()) = Result(h+1, a)
match def update_score(Result(h,a), Away()) = Result(h, a+1)
only if I use Away() will it work
ahh, I have to put @addpattern in front of each line
and the match in front of def is not necessary
Evan Hubinger
@evhub
Oct 02 2017 17:34
@tek Coconut definitely shouldn't be ignoring the --mypy arg! What specific commands are you running? One possibility is that if --mypy isn't appearing at the end, you'll get an error since Coconut treats all arguments after --mypy as arguments to MyPy, not Coconut.
@LeHoff_twitter Yup, I think you got it!
Torsten Schmits
@tek
Oct 02 2017 17:36
@evhub I copied the command line from the plugin's debug output and it worked, line was: coconut --target 3.6 --strict --quiet /home/tek/code/tek/python_nvim/ribosome/ribosome/machine/state_f.coco --mypy --follow-imports=silent --incremental --strict-optional --warn-redundant-casts --warn-no-return --warn-unused-ignores --show-error-context --show-column-numbers --check-untyped-defs --disallow-untyped-calls --disallow-untyped-defs
without --quiet, the plugin reported the output to contain the compiling... and done line, but nothing else, so it seemed that output was suppressed
maybe mypy is silently not executed if it's not found?
oops, wait, I just tried again and it worked
Torsten Schmits
@tek
Oct 02 2017 17:41
never mind :)
nope, false positive
it worked on the python file, but not the coco file
or is that the expected behaviour?
if it is, I'll probably be able to write something that converts the line numbers and file name
Evan Hubinger
@evhub
Oct 02 2017 17:47
The command you copied looks right to me, though it's definitely true that with --quiet you won't see the stuff about compiling, though you should still see the MyPy output. And yeah, MyPy output gives Python line numbers, though if you pass --line-numbers, the compiled Python will have comments in it signaling what line in the Coconut source produced that line in the output.
Evan Hubinger
@evhub
Oct 02 2017 18:00
@tek It's definitely a good point, though, about automatically converting the Python line numbers to Coconut line numbers in the MyPy output. That's definitely something Coconut could do using the existing --line-numbers machinery. I just raised #332 to track it.
Torsten Schmits
@tek
Oct 02 2017 18:00
nice!
Torsten Schmits
@tek
Oct 02 2017 21:26
@evhub yess I got it to run with neomake :D one step closer to integrating coconut into my routine. code: https://github.com/tek/amino/blob/master/amino/util/coconut_mypy.py (shameless plug of my FP lib)