Skip to content

CLI argument to ignore paths #250

@silverwind

Description

@silverwind

In some cases, it's desirable to not format certain files like test fixtures. Ignoring such files can be achieved by passing a explicit list of files to gofump, but then big projects risk into running into the maximum command line length which on Windows is only 8191 characters.

I suggest to support a -exclude argument where users could pass individual files to exclude to the CLI. It should support both file and directory arguments. Another benefit of such a argument is to speed up the invocation by ignoring big directories like node_modules which often contain upwards of 100k files.

go run mvdan.cc/[email protected] -exclude test/fixture.go,fixtures,node_modules .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions