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

Format only files selected by pre-commit #851

Merged
merged 1 commit into from
Jun 23, 2024

Conversation

m-fila
Copy link
Contributor

@m-fila m-fila commented Jun 22, 2024

The hook will be more useful if it would work on a list of files given to it by pre-commit. For instance pre-commit run will check only files in the staging area, pre-commit run --all-files will run on all the files. Additionally the hook should respect the exclude directive of pre-commit.

This PR adds support to working on the lists of files provided by pre-commit

@domluna
Copy link
Owner

domluna commented Jun 22, 2024

If you pass no files would be default to "." ?

@m-fila
Copy link
Contributor Author

m-fila commented Jun 22, 2024

Pre-commit will skip a hook if there are no eligible files

@domluna
Copy link
Owner

domluna commented Jun 23, 2024

ok this looks good to me

@domluna domluna merged commit 50f9a71 into domluna:master Jun 23, 2024
56 checks passed
@m-fila m-fila deleted the pre_commit_select_files branch June 24, 2024 09:24
@abelsiqueira
Copy link
Contributor

Can we have a new release so this and #840 are available, please?

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

3 participants