Skip to content

Exclude target directory #341

@IceBlizz6

Description

@IceBlizz6

I'm using apt/kapt to auto generate some source files.
I want to exclude these when running ktlint check
This is a maven project.

<plugin>
    <groupId>com.github.gantsign.maven</groupId>
    <artifactId>ktlint-maven-plugin</artifactId>
    <version>1.4.2</version>
    <configuration>
        <sourcesExcludes>
            <sourcesExclude>target/generated-sources/kapt/compile/*</sourcesExclude>
            <sourcesExclude>**/generated-sources/kapt/**</sourcesExclude>
            <sourcesExclude>target/generated-sources/kapt/compile/**</sourcesExclude>
            <exclude>target/generated-sources/kapt/compile/*</exclude>
            <exclude>target/generated-sources/kapt/compile/**</exclude>
            <exclude>target/generated-sources/kapt/compile</exclude>
            <exclude>**/generated-sources/kapt/**</exclude>
        </sourcesExcludes>
    </configuration>
    <executions>
        <execution>
            <id>check</id>
		<goals>
                    <goal>check</goal>
		</goals>
	  </execution>
    </executions>
</plugin>

I have tried sourcesExcludes with many different values as shown above,
But it is still reporting errors in these files.

How do i exclude directories?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions