Closed AucaCoyan closed 1 year ago
maybe we should leave the examples? i put them there are test cases. We'll also want to have benchmarks eventually. I mean we can delete it now but we'll need to bring it back at some point.
Mmm I'm not sure. What do you think if we do examples in markdown documentation?
For bench marking, initially I was thinking on doing multi threading, but after looking on other big projects I realized they don't go that deep. I assume it's because it's a fast process in general. On top of that, performance in rust is rarely an issue.
If we start waiting more that 2 seconds to format a file, then yes, we should lookout for performance. But initially it's not among my concerns. I've never written performant software, or ever have to worry about memory management even, so bear in mind I'm not an expert
i'm fine with having markdown docs but what i'm saying was that in order to test whether the software is formatting things properly, i had examples to test on.
as far as performance, it all depends on the size of the file. i have a > 4000 line script that takes a while to parse. so if parsing takes a while, reformatting could take longer.
i'm also fine with having lots of smaller tests to test in small bits.
Sounds good to me.
I copied the example.nu
which has 2400 lines and also ajust the bench for the current format_single_file
function
How about now? should I add more changes? 🙌🏼
We can change it later when we get around to it, but example.nu is not a valid script. It's just a dump of all the examples from nushell. So, the syntax isn't correct in it. Although, I think it's a good test to see what nufmt does with an invalid script.
@AucaCoyan i do not see tests in there, am i missing something? :open_mouth:
Hi! I pushed a bit more the repo and I think it's ready to move to the nushell org. Maybe
nushell/nufmt
?Some comments:
clippy_check.yml
intopul_request.yml
andmain.yml
, so we can have different workflows on every event.examples/
folderformat_nu
andformat_nu_buffered
and some tests with it. So this repo doesn't have more lines that are deprecated.