Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added args and exclude_types to hook type #414

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

joedevivo
Copy link

Creating new hooks allows for args and exclude_types.

In particular, I wanted to configure shfmt to not force the -s flag. I changed the default configuration for shfmt to have args = [ "-s" ] to not break anything for anybody, but it allows me to disable it, and add other flags.

@joedevivo joedevivo force-pushed the args-and-exclude_types branch 2 times, most recently from 9534357 to 72bce63 Compare March 22, 2024 17:16
Copy link
Member

@sandydoo sandydoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 to bothexclude_types and args.

Regarding shftm, args is a good fallback/escape-hatch when a hook is missing module options, but we shouldn't make a habit of setting a default of anything other than [].
Let's maybe expose this as hooks.shftm.settings.simplify and set it to true by default for backwards-compatibility? Perhaps in a separate PR?

type = types.listOf types.str;
description = lib.mdDoc
''
List of file types to exclude. See [Filtering files with types](https://pre-commit.com/#plugins).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
List of file types to exclude. See [Filtering files with types](https://pre-commit.com/#plugins).
List of file types to exclude. See [Filtering files with types](https://pre-commit.com/#filtering-files-with-types).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants