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

add a --filter-to-files global option which python checkstyle can use to go faster in the pre-commit hook #7070

Closed
cosmicexplorer opened this issue Jan 13, 2019 · 3 comments

Comments

@cosmicexplorer
Copy link
Contributor

See #7069 -- we might like to speed up the pre-commit hook by making it only work on staged files, but there's not currently a way to filter down to files in between targets. Introducing a global option which tasks such as python checkstyle could use to filter the input files they pass into a subprocess could be an easy way to speed up a variety of tasks.

@illicitonion
Copy link
Contributor

If this is meant to affect all tasks, doing something like:

files=($(for f in $(git diff --name-only --cached); do echo "--owners-of=${f}"; done))
./pants "${files[@]}" test

would probably work?

If this is only meant to affect one task, or one goal, I'd want to introduce a per-task or per-goal option...

@cosmicexplorer
Copy link
Contributor Author

Thinking about your comment, I think it is probably very doable to add this in target_restriction_mixins.py alongside SkipAndTransitiveGoalOptionsMixin, for checkstyle tasks (as they wish). I agree that a global option doesn't really make sense.

@Eric-Arellano
Copy link
Contributor

Closing as this plugin has been deprecated and will soon be removed.

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

No branches or pull requests

3 participants