Skip to content

Feature: -PspotlessIdeHook with multiple files #791

@aloifolia

Description

@aloifolia

I am using -PspotlessIdeHook to have spotless format all files that lint-staged detects. So, before a commit succeeds, lint-staged triggers spotless individually for each file since the -PspotlessIdeHook parameter accepts single files only. For interested parties - this is my lint-staged configuration:

module.exports = {
    '*.{js,scss,md,ts,json,yml,yaml,html}': (filenames) =>
       filenames.map((filename) => `./gradlew spotlessApply "-PspotlessIdeHook=${filename}"`),
};

Although this approach works, the duration of which is quite underwhelming as gradle needs to start all-over for each file. It would be nice to be able to pass entire batches of file names to spotless (alternatively make lint-staged obsolete).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions