probablykasper / cpc

Text calculator with support for units and conversion
https://crates.io/crates/cpc
MIT License
121 stars 14 forks source link

Add CI to run the tests #13

Closed djmattyg007 closed 2 years ago

djmattyg007 commented 3 years ago

It would be good to set up something like Github actions to run the tests, so that they're automatically validated when someone submits a PR.

djmattyg007 commented 3 years ago

Similarly it would be good to run rustfmt and verify it with CI.

probablykasper commented 3 years ago

Yeah, a GitHub action would make sense. If I recall correctly, rustfmt screws up a lot of the formatting, so it would need to be disabled for certain files (or configured in some weird way?).

djmattyg007 commented 3 years ago

It might be worth just accepting what rustfmt outputs if it's more consistent with the broader rust ecosystem.

probablykasper commented 3 years ago

Yeah, the main thing is that in units.rs it does this:

-  Nanosecond:         (Time, d128!(1)),
-  Microsecond:        (Time, d128!(1000)),
+  Nanosecond: (Time, d128!(1)),
+  Microsecond: (Time, d128!(1000)),

I'll look into if there's a way to prevent that because it makes it less readable and harder to edit.

The other thing is that I'd like all the matches in lexer.rs to be on single lines, but for that I can make the max line width an insane 200.

probablykasper commented 3 years ago

Couldn't find any option for it. Would work to use ignore = [ "units.rs", "lookup.rs" ], but the ignore option isn't stable yet

probablykasper commented 2 years ago

Added test CI