Skip to content

Respect .styluaignore when explicitly passing in file names #751

@mrcjkb

Description

@mrcjkb

Hi 😄

I have a git pre-commit hook that calls stylua with file names (the staged files),
and I noticed that when passing in a file (rather than a directory), it is formatted, even if the file matches .styluaignore.

Is this intended behaviour? If so, I'm wondering if there's a way to modify this behaviour so that it works with pre-commit hooks, or if it would make sense to add a CLI flag?
(asking before I go ahead and open a PR)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions