Closed Goddchen closed 1 week ago
The path of the analyzed file is readily available. You should be able to find the enclosing .git directory from it.
Ah, that was totally my bad. I was focusing on somehow grabbing the Git branch name on the plugin level and not on the rule level 🤦♂️
Is your feature request related to a problem? Please describe. I want to implement a custom lint that does some validation for the ticket you are currently working on. To get the ticket, I'd love to simply use something like
git branch --show-current
. Unfortunately, the custom_lint process is executed in a temp directory, so I do not have access to the Git repo / working directory of the project. Another alternative for me would be to read the Git branch name from an environment variable. But it seems like the custom_lint child process does not inherit its parent environment.Describe the solution you'd like I'd love to have some way of knowing the project working directory. Or to be able to pass environment variables to the custom_lint process.
Any idea how this could be achieved?