getgrit / gritql

GritQL is a query language for searching, linting, and modifying code.
https://docs.grit.io/
MIT License
3.17k stars 82 forks source link

fix: 445 `--lang` aliases #544

Closed Alex-ley-scrub closed 4 weeks ago

Alex-ley-scrub commented 1 month ago

@algora-pbc /claim #445

verified as fixed with (fails before PR commits succeeds after):

echo 'console.log(hello)' | cargo run -- apply '`hello` => `goodbye`' --stdin --lang=javascript

two test cases added to cover this in crates/cli_bin/tests/apply.rs which also verifies fix (fails before PR commits succeeds after - cargo test --test apply)

Greptile Summary

This is an auto-generated summary

Hi! Looks like you've reached your API usage limit. You can increase it from your account settings page here: app.greptile.com/settings/usage

Alex-ley-scrub commented 1 month ago

some screenshots

before:

echo 'console.log(hello)' | cargo run -- apply '`hello` => `goodbye`' --stdin --lang=javascript

image

after:

echo 'console.log(hello)' | cargo run -- apply '`hello` => `goodbye`' --stdin --lang=javascript

image

echo 'console.log(hello)' | cargo run -- apply '`hello` => `goodbye`' --stdin --lang=javascrip

image

Alex-ley-scrub commented 4 weeks ago

Hi @morgante - is there anything left for me to do before this can be merged? Thanks for your review, the final solution is pretty nice 👌