gritql icon indicating copy to clipboard operation
gritql copied to clipboard

String equivalence in yaml

Open morgante opened this issue 1 year ago â€ĸ 2 comments

Two different yaml strings should be treated identically in patterns.

For example, this pattern should match all 3 nodes in the yaml file:

language yaml

`'ubuntu-latest'`

Sample file:

steps:
    - runs_on: "ubuntu-latest"
    - runs_on: 'ubuntu-latest'
    - runs_on: ubuntu-latest

It looks like the problem is the underlying AST representations are different in the yaml grammar between single-quote and double-quote strings.

morgante avatar Jul 01 '24 21:07 morgante

hey @morgante , I would like to work on this. I'm new to this project. Can you help me understand this problem?

dekkku avatar Jul 05 '24 19:07 dekkku

Hi @dekkku I've added some more details on the problem above.

In theory we already have some logic for normalizing "equivalence classes" like this: https://github.com/getgrit/gritql/blob/b526a07022ef8b5b2c1969763d11955d4b332c4c/crates/language/src/yaml.rs#L119C8-L133

Unfortunately it doesn't seem to be working as intended.

morgante avatar Jul 05 '24 20:07 morgante

/bounty $50

morgante avatar Oct 28 '24 20:10 morgante

💎 $50 bounty â€ĸ Grit

Steps to solve:

  1. Start working: Comment /attempt #394 with your implementation plan
  2. Submit work: Create a pull request including /claim #394 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Thank you for contributing to getgrit/gritql!

Add a bounty â€ĸ Share on socials

Attempt Started (GMT+0) Solution
đŸŸĸ @asr2003 Oct 28, 2024, 8:11:24 PM WIP
🔴 @animeshd9 Oct 29, 2024, 6:28:32 PM WIP
đŸŸĸ @Alex-ley-scrub Oct 29, 2024, 11:29:18 PM #569

algora-pbc[bot] avatar Oct 28 '24 20:10 algora-pbc[bot]

/attempt #394

Algora profile Completed bounties Tech Active attempts Options
@asr2003 8 bounties from 4 projects
Rust, Scala,
Go & more
Cancel attempt

asr2003 avatar Oct 28 '24 20:10 asr2003

/attempt #394

Options

animeshd9 avatar Oct 29 '24 18:10 animeshd9

/attempt #394

Algora profile Completed bounties Tech Active attempts Options
@Alex-ley-scrub 4 grit bounties
Rust
īšŸ539
Cancel attempt

Alex-ley-scrub avatar Oct 29 '24 23:10 Alex-ley-scrub

💡 @Alex-ley-scrub submitted a pull request that claims the bounty. You can visit your bounty board to reward.

algora-pbc[bot] avatar Oct 29 '24 23:10 algora-pbc[bot]

🎉🎈 @Alex-ley-scrub has been awarded $50! 🎈🎊

algora-pbc[bot] avatar Nov 04 '24 02:11 algora-pbc[bot]