getgrit / gritql

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

Aliases for `--lang` #445

Closed morgante closed 6 days ago

morgante commented 2 months ago

I'd like to be able to use aliases like py for the lang argument:

grit apply --lang py 'identifier()'
error: invalid value 'py' for '--language <LANGUAGE>'
  [possible values: js, html, css, json, java, csharp, python, markdown, go, rust, ruby, solidity, hcl, yaml, sql, vue, toml, php, phponly]

  tip: a similar value exists: 'python'
morgante commented 2 months ago

/bounty $20

ORESoftware commented 2 months ago

looking at this - I don't see '--language' or 'invalid value' in the codebase - looking for the source for the CLI option grit apply

looks like cli/src/commands/apply.rs is the place

ORESoftware commented 2 months ago

Here's my first stab at it: https://github.com/getgrit/gritql/pull/478

morgante commented 1 month ago

@itsdheerajdp Don't submit code you never ran. Until you actually validate that the command shared fixes the issue it isn't worth my time to review.

Alex-ley-scrub commented 1 week ago

@algora-pbc /attempt #445

algora-pbc[bot] commented 6 days ago

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