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

Code fence parser misses indentation #219

Open
jayvdb opened this issue Jul 29, 2023 · 4 comments
Open

Code fence parser misses indentation #219

jayvdb opened this issue Jul 29, 2023 · 4 comments
Labels
A-trycmd Area: trycmd package bug Not as expected

Comments

@jayvdb
Copy link

jayvdb commented Jul 29, 2023

In Electron100/butane@c5761cc I attempted to set up trycmd on some existing .md files. I only got "ignored", so I added "debug" feature (not mentioned in this projects README.md), and still there is no reason given. I guess it is something path related, and I'll be able to figure it out, but this should be in the debug logs at least, and IMO if a .case(..) is explicitly specified in the .rs, and trycmd couldnt find anything runnable in the file(s) mentioned, then it is an error.

     Running tests/cli_tests.rs (/home/jayvdb/rust/butane/target/debug/deps/cli_tests-41b60687d15705c6)

running 1 test
[              trycmd::runner] 	Case: Ok(
    Output {
        path: "../examples/getting_started/README.md",
        id: None,
        spawn: Spawn {
            exit: None,
            status: Skipped,
        },
        stdout: None,
        stderr: None,
        fs: Filesystem {
            context: [],
        },
    },
)
Testing ../examples/getting_started/README.md ... ignored
[              trycmd::runner] 	Case: Ok(
    Output {
        path: "../example/README.md",
        id: None,
        spawn: Spawn {
            exit: None,
            status: Skipped,
        },
        stdout: None,
        stderr: None,
        fs: Filesystem {
            context: [],
        },
    },
)
Testing ../example/README.md ... ignored
test cli_tests ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
@jayvdb
Copy link
Author

jayvdb commented Jul 29, 2023

this doesnt appear to be #105 , as the bin="xxx" not found is missing from my output

@jayvdb
Copy link
Author

jayvdb commented Jul 29, 2023

It looks like the problem is the .md parser doesnt like indented blocks.

@epage
Copy link
Contributor

epage commented Jul 31, 2023

Yes, our code fence parser is very minimal

@epage epage added bug Not as expected A-trycmd labels Jul 31, 2023
@epage epage changed the title Cases ignored without any explanation Code fence parser misses indentation Jul 31, 2023
@epage
Copy link
Contributor

epage commented Jul 31, 2023

Indentation parsing gets complicated because it means we have to handle correctly indenting / de-indenting the contents too, especially with TRYCMD=overwrite.

For that reason, I'm tempted to not support indented code fences but I think we should at least report the code fences exist in a way so people know whats happening

@settings settings bot removed the A-trycmd label Aug 14, 2023
@epage epage added the A-trycmd Area: trycmd package label Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-trycmd Area: trycmd package bug Not as expected
Projects
None yet
Development

No branches or pull requests

2 participants