adapt ast-grep to do some lint in CI #16258

Closed
opened 2026-02-21 19:25:20 -05:00 by yindo · 1 comment
Owner

Originally created by @asukaminato0721 on GitHub (Aug 19, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

Now that the codebase is huge, a project-related linter will be useful.

Maybe it can keep the style unified.

2. Additional context or comments

https://github.com/ast-grep/ast-grep

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @asukaminato0721 on GitHub (Aug 19, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report, otherwise it will be closed. - [x] Please do not modify this template :) and fill in all the required fields. ### 1. Is this request related to a challenge you're experiencing? Tell me about your story. Now that the codebase is huge, a project-related linter will be useful. Maybe it can keep the style unified. ### 2. Additional context or comments https://github.com/ast-grep/ast-grep ### 3. Can you help us with this feature? - [x] I am interested in contributing to this feature.
yindo added the 💪 enhancement label 2026-02-21 19:25:20 -05:00
yindo closed this issue 2026-02-21 19:25:20 -05:00
Author
Owner

@asukaminato0721 commented on GitHub (Aug 19, 2025):

For example

ast-grep --pattern 'db.session.query($WHATEVER).filter($HERE)' -l py

this can find all .filter

ast-grep --pattern 'db.session.query($WHATEVER).filter($HERE)' --rewrite 'db.session.query($WHAT
EVER).where($HERE)' -l py

this do all the rewrite

@asukaminato0721 commented on GitHub (Aug 19, 2025): For example ``` ast-grep --pattern 'db.session.query($WHATEVER).filter($HERE)' -l py ``` this can find all .filter ``` ast-grep --pattern 'db.session.query($WHATEVER).filter($HERE)' --rewrite 'db.session.query($WHAT EVER).where($HERE)' -l py ``` this do all the rewrite
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#16258