New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature] Share rules #628
Comments
Hi @q0w , thanks for your continuous support for ast-grep! Sharing rules are not done on purpose because I have not decided the best way to share rules. Is using git submodule solving your problem? Or publishing it on npm? Looking forward to your feedback. |
I can package my rules through pypi, but the problem is an auto-discovery of these rules. Users can use different names for virtualenv. I cant force it in config ruleDirs. Maybe local configs + default root config can solve this |
If I understand it correctly, you are suggesting local configs which can discover rules installed in virtualenv? |
I think ast-grep should not implement pyp's resolution logic. Local config is needed to provide a path for a local venv. So there is a root config ruleDirs:
- .rules
- .venv/package-name/rules # default venv name And there is a local user config which is not tracked by git ruleDirs:
- .venv2/package-name/rules # user's venv name Ast-grep should merge ruleDirs = .rules + .venv/package-name/rules + .venv2/package-name/rules |
⭐ Suggestion
A way to use external rules, not only in local dirs.
💻 Use Cases
I want to implement a set of rules in one repo and use it in another. It would be great with some way to enable external rules.
The text was updated successfully, but these errors were encountered: