-
-
Notifications
You must be signed in to change notification settings - Fork 301
Description
⭐ Suggestion
Allow $CONFIG_DIR or similar expansion in the files: section.
💻 Use Cases
I am in a monorepo with a top-level sgconfig.yml. I would like to have rules that only apply to specific subdirectories. I have not been able to find a way to do this that works both when ast-grep scan is invoked from the top-level folder containing the sgconfig.yml and when it's invoked from a subfolder.
As far as I can tell from experimentation, the files section appears to be treated as relative to the cwd from which ast-grep was invoked rather than the dir containing the sgconfig.yml file, whereas I need the opposite behavior. A possible solution is to provide a $CONFIG_DIR variable that is expanded to the absolute path of the directory containing the sgconfig.yml, but this is just one idea and there may be several other potential solutions.