rust-maven-plugin icon indicating copy to clipboard operation
rust-maven-plugin copied to clipboard

Add `cargo clippy` support

Open Mark1626 opened this issue 6 months ago • 0 comments

I'm using this plugin in one of my projects, and I thought it would be nice to run clippy from the plugin.

Approach could be similar to #8

<plugin>
    <groupId>io.questdb</groupId>
    <artifactId>rust-maven-plugin</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <executions>
        <execution>
            <id>build-myrust</id>
            <goals>
                <goal>build</goal>
            </goals>
        </execution>
        <execution>
             <id>test-myrust</id>
             <goals>
                 <goal>test</goal>
             </goals>
        </execution>
        <execution>
             <id>test-lintrust</id>
             <goals>
                 <goal>clippy</goal>
             </goals>
             <configuration>
                // Configurations for clippy
             </configuration>
        </execution>
    </executions>
    <configuration>
        <path>src/main/rust/myrust</path>
        <release>true</release>
        <copyTo>${project.build.directory}/bin</copyTo>
    </configuration>
</plugin>

This can be implemented by extending CargoMojoBase into CargoClippyMojo similar to CargoTestMojo

I'm happy to implement this and raise a PR, if you feel this could be useful upstream.

Mark1626 avatar Aug 10 '25 16:08 Mark1626