Skip to content

Make AST Grep Rule Directories Configurable via Environment Variables#134

Closed
maks-ivanov wants to merge 1 commit intomainfrom
cosine/configurable-ast-grep-rules-s3t4lc
Closed

Make AST Grep Rule Directories Configurable via Environment Variables#134
maks-ivanov wants to merge 1 commit intomainfrom
cosine/configurable-ast-grep-rules-s3t4lc

Conversation

@maks-ivanov
Copy link
Contributor

This pull request modifies the AST Grep client to allow configuration of rule directories through environment variables. The default paths for symbol, identifier, and reference configuration files are retained, but users can now override these defaults by setting the respective environment variables: AST_GREP_SYMBOL_CONFIG, AST_GREP_IDENTIFIER_CONFIG, and AST_GREP_REFERENCE_CONFIG.

The changes include:

  • Added functions to retrieve the configuration paths, checking for environment variables first.
  • Updated the scan_file calls to use the new functions instead of hardcoded paths.

This enhancement is particularly useful for users running pre-built Docker images, as it provides flexibility in configuring the paths without modifying the code.


This pull request was co-created with Cosine Genie

Original Task: lsproxy/1r5d2b2g6tma
Author: Maksim Ivanov

@maks-ivanov maks-ivanov closed this Jul 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant