intellij-move icon indicating copy to clipboard operation
intellij-move copied to clipboard

Linter that can be used in CI

Open Ao-senXiong opened this issue 3 months ago • 5 comments

Thanks for this great tool. Is there any linter for format and code clean that can be used in CI that will fail the build process if the code is not format right?

Ao-senXiong avatar Apr 02 '24 01:04 Ao-senXiong

Hi, you can use Qodana for that. https://www.jetbrains.com/qodana/

I made an example repo here https://github.com/mkurnikov/qodana-move

mkurnikov avatar Apr 02 '24 17:04 mkurnikov

Hi @mkurniko, thanks! Do they also have formatter for move? Like command line tool that automatically format the code to the desired format

Ao-senXiong avatar Apr 02 '24 20:04 Ao-senXiong

There's a way to run the formatter from the plugin as a CLI application https://www.jetbrains.com/help/idea/command-line-formatter.html You'd also need to install Intellij-Move plugin either manually from the IDE, or from the CLI, see https://www.jetbrains.com/help/idea/install-plugins-from-the-command-line.html

It has a nasty limitation that it can't be executed if you have an IDE instance running already, so, i.e/ CLI pre-commit hooks doesn't really work how they're supposed to.

mkurnikov avatar Apr 02 '24 20:04 mkurnikov

Hi @mkurnikov, thanks for sharing so much. I hope there is something more general work regards the IDE. Looks Qodana only does the checks but does not have the option to enforce the code style.

Ao-senXiong avatar Apr 03 '24 01:04 Ao-senXiong

Could you expand on "enforcing the code style", what do you mean by that?

mkurnikov avatar Apr 03 '24 10:04 mkurnikov