Usage of variables in "includes" glob pattern #113
ThijmenDam
started this conversation in
Ideas
Replies: 1 comment
-
Hi @ThijmenDam, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi @alirezanet and contributors, first of all I'd like to thank you for this very useful package.
So, our team would greatly benefit from the possibility of using variables in the "include" glob pattern. For example:
The reason this would be very useful for our team is performance. To elaborate, some of our repositories contain multiple solutions, and without variables in the "include" glob pattern, we are not able to execute
dotnet format
only for the solutions that contain staged files. This means thatdotnet format
is executed for every solution, even if there are no staged files from that solution (which slows down the pre-commit hook by a lot).To illustrate, consider the following pre-commit hook:
We pass the solution directory as argument, because
dotnet format
requires the workspace to be provided as command line argument wheneverdotnet format
is executed from a directory that does not contain a solution file (i.e. the root of our repository).To conclude, if we could use the
${args}
variable in the "include" glob pattern,dotnet format
would only be executed for solutions that contain staged files. Which saves a lot of time for repositories with multiple solutions!Thanks for reading, and I'd love to hear what you think of this.
Best,
Thijmen
Beta Was this translation helpful? Give feedback.
All reactions