skate
skate copied to clipboard
feat: add suggestions
builds off of the delete-db
PR. Suggests a db name that does exist based on the first two characters of a mistyped arg. Just kept it simple, but would be great to hear if there are better ways to do this. I also experimented with having a more reusable function for getting the []os.DirEntry
for a default client.
Would also love some guidance on how I could write tests for this ðŸ’
Hmmm tests are making CI fail with /home/runner/.local/share/charm/cloud.charm.sh/kv: no such file or directory
.
Open to suggestions on how to make it more stable :)
Yeah, so my tests are making the Ubuntu build fail... Going to need to change the path to a temp dir with an env variable (CHARM_DATA_DIR=<path-to-temp-dir>
) for tests to pass? Gonna check it out
noice!
Not sure if I should also add a check for reflect.DeepEqual on the suggestions we get back 🤔. Not sure that ordering is consistent... Will check if it changes anything locally, so don't merge yet pls 😄
oookay I improved the tests and added a formatting func for the databases which I needed for the tests and hopefully makes formatting dbs more reusable. It adds an extra loop for our getDbs
function though which is not ideal because I want the formatting func to take a []string
as arg
Will update the crypto
package (charm
is the direct dep) in another PR to fix the CI errors