question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ability to run subset of hooks, not just one

See original GitHub issue

Hi folks! Wondering if adding the ability to run a subset of checks rather than just one is possible. For example, instead of only being able to run a black check: pre-commit run black. Be able to run something like pre-commit run black,flake8 to run the black and flake8 checks.

This would be especially useful for me since I am working on creating a shared pre-commit container/configuration for multiple repositories, but not all of them want to run every available check (only a subset).

I’m also aware there is a workaround for this, running something like pre-commit run black && pre-commit run flake8 but figured another solution may be more elegant.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
brandon-leapyearcommented, Mar 30, 2022

Likewise, even support for globs, like

pre-commit run '*-formatter'

which would run all hooks matching the pattern

1reaction
christhekeelecommented, Apr 10, 2021

I’d really benefit from this. I have a great many hooks, organized into “suites” (auto-formatters, linters, typecheckers) I want to run together (as a little script).

Current options

&&

# file: bin/format
pre-commit run json-formatter && pre-commit run python-formatter && ...
CON

This has to re-stash between every single hook, which is really adding up

SKIP

# file: bin/format
SKIP=enumerate,every,single,non-format,hook... pre-commit run
CON

This is much harder to understand and maintain

Desired option

# file: bin/format
pre-commit run json-formatter python-formatter...
Read more comments on GitHub >

github_iconTop Results From Across the Web

Hooks at a Glance - React
Hooks are a new addition in React 16.8. They let you use state and other React features without writing a class. Hooks are...
Read more >
React useEffect Hook when only one of the effect's deps ...
itemId]); // I want this effect to run only when 'props.itemId' changes, // not when 'items' changes useEffect(onItemIdChange, [ props.
Read more >
How To Manage State with Hooks on React Components
With Hooks, state objects are completely independent of each other, so you can have as many state objects as you want.
Read more >
Understanding common frustrations with React Hooks
React Hooks can be frustrating despite their popularity and widespread use. Learn about some of the drawbacks to using React Hooks.
Read more >
Can We All Just Admit React Hooks Were a Bad Idea? - Medium
Part 1: SOLID reasons why hooks are a bad idea ... if you wanted to maintain your state outside the components, but not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found