erg icon indicating copy to clipboard operation
erg copied to clipboard

Configure `cargo fmt` and `cargo clippy`

Open cm-ayf opened this issue 3 years ago • 3 comments

Currently, this project does not seem to utilize cargo fmt and cargo clippy, which would be important in near future.

I tried executing cargo fmt for all crates, and produced a huge amount of diff. Git features, like git blame, are not good at handling formatting differences, so I suggest we format everything before it's too late.

This issue depends on #4 . cargo fmt did not format everything when current directory is on root because workspace feature is not utilized.

cm-ayf avatar Aug 12 '22 19:08 cm-ayf

I ran cargo clippy and fixed some warnings, but found that there were too many and some of them were extremely troublesome to fix.

I would like to put this issue aside for now.

mtshiba avatar Aug 12 '22 22:08 mtshiba

I understand cargo clippy is troublesome, so I again suggest running just cargo fmt for now.

cm-ayf avatar Aug 13 '22 03:08 cm-ayf

Oh I forgot to say that. I've already done.

https://github.com/erg-lang/erg/commit/6726d93f65493a01c1c323658509d99a57fb601e

mtshiba avatar Aug 13 '22 04:08 mtshiba

This issue has been solved with https://github.com/erg-lang/erg/commit/fa33a2003b9ed530178ff85d4a9cc2f564ceebcc. I have introduced pre-commit, and I encourage everyone who sends PRs to use this.

mtshiba avatar Aug 18 '22 02:08 mtshiba