question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow for using a `PatternFilterable` to determine source processed by `JavaExtension` and `KotlinExtension`

See original GitHub issue

Sometimes you want your entire source code to be linted/formatted except for some code in a particular package.

For example, in my project I want everything reformatted except for things in files that match the pattern **/generated/**.

When setting up my java source sets, if I didn’t want these files to be compiled I could do something like this:

sourceSets {
    "main" {
        java {
            exclude("**/generated/**")
        }
    }
}

I propose that spotless should expose the same API for filtering out sources that I don’t want to be linted or reformatted.

I would expose an API that allowed the user to use a PatternFilterable to configure what is excluded from the task’s target FileCollection.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
JLLeitschuhcommented, Oct 14, 2017

It’s not time. It’s just that most of it lives on a git branch that has deviated so far from master that it’s going to be difficult to redo. I still have the branch checked out in a separate clone of the repo on my work machine.

I had to move a lot of code around to get it to work, ended up deleting some irrelevant projects for that the feature was making irrelevant, ect. That feature (actually more of a full project) got killed so the old code was still relevant.

I can port much of the same gradle logic, but I need to do the refactor and move code around dance all over again.

0reactions
nedtwiggcommented, Feb 12, 2019

Fixed in 3.18.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

PatternFilterable (Gradle API 7.6)
A PatternFilterable represents some file container which Ant-style include and exclude patterns or specs can be applied to. Patterns may include:.
Read more >
Kotlin Language Documentation 1.7.21
Using with kapt. Command-line compiler. Kotlin Symbol Processing API. Overview. How KSP looks at source files.
Read more >
PatternFilterable - api
A PatternFilterable represents some file container which Ant-style include and exclude ... then files must not match any exclude pattern to be processed....
Read more >
Gradle User Manual | PDF | Command Line Interface - Scribd
You can see this with most language plugins, which add the concept of source sets to a build. Appropriate modeling of a build...
Read more >
PDF - Kotlin 官方文档中文版
See the Create and publish a multiplatform library tutorial, ... It allows Kotlin developers to use familiar language features such.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found