Closed garbas closed 1 year ago
It doesn't work yet, because Nix makes it really hard to customize $PS1.
The root of the problem to get nix-shell
to work is actually to filter out ASCII escape code.
The solution would also be to include the ASCII escape code in your markdown files, but: 1) I don't expect people to write this 2) code highlighters to show the ASCII escape code correctly (pygments can do this via extension but github for example doesn't)
I think the only sane way is make this work is to filter out ASCII escape code and this is what I did.
I think this should also be the default behavior, but it would be nice to be also able to test colors in your terminal at times. So maybe we should make it possible to not filter out ASCII escape code.
Also... should we be running demos in the CI to make sure they work?
Filtering out the colors sounds good, if someone needs it they can implement a selection to turn it on.
Yeah, let's have a test for nix-shell since it's crucial.
@domenkozar I've renamed demo
to examples
and I've added them to CI. I think you need to click some button to approve CI to run
src/tesh/test.py:19:1: D102 Missing docstring in public method
src/tesh/test.py:25:1: D102 Missing docstring in public method
2023-07-26T11:59:59.1305122Z yamllint.................................................................Passed 2023-07-26T12:00:05.1128123Z src/tesh/test.py:19: error: Function is missing a type annotation [no-untyped-def] 2023-07-26T12:00:05.1129739Z src/tesh/test.py:29: error: Function is missing a type annotation [no-untyped-def] 2023-07-26T12:00:05.1130528Z src/tesh/test.py:48: error: Skipping analyzing "tesh._async": module is installed, but missing library stubs or py.typed marker [import] 2023-07-26T12:00:05.1132142Z src/tesh/test.py:48: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
I see, code coverage is below 100. Lets add some tests
I'll also add some lines to CHANGELOG
Checking examples/nix-shell.md ✨ Running nix-shell ❌ Failed Command: which hello
Expected:
which: no hello in (*) Got:
This breaks test for me locally, but lets gets CI happy first :)
@domenkozar I don't want to burden you to click "Approve run" all the time. Would it be possible to get me enough permission so that this runs are triggered automatically.
I've changed the settings to always run, let's see if it works now.
@domenkozar: Ready for merging to my eyes, anything else I missed?
I was trying to use
tesh
to test some of my code example in markdown, but I couldn't getnix-shell
to work. I think I'm missing something obvious.I've added the minimal demo where I try to use
nix-shell
.You can run it by: