Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: Support for XML/HTML tags on the API calls and a myriad of oth…
…er things (#20) * 📝 Add badge to README.md * 📝 change usage text * 💪 Delete `stdin` flag * 📝 Update README * ⤴ Update version of library * 🥷 divide package * 🐛 fix test and ci * 💪 Add test * 🐛 Fix default config directory permission to 0755 To avoid "permission denied" * Add renovate.json (#11) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore: use conventional commit (#15) * Update module github.com/mattn/go-isatty to v0.0.19 (#12) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update module github.com/urfave/cli/v2 to v2.25.7 (#13) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update actions/checkout action to v4 (#16) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update actions/setup-go action to v4 (#17) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update goreleaser/goreleaser-action action to v5 (#18) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * build: update golang version * ci: update ci * ci: fix go-version * fix(deps): update module github.com/mattn/go-isatty to v0.0.20 (#19) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore: update .goreleaser * build: update go.sum * Chore: small fixes Mostly English spelling and getting rid of deprecated Go functions. * chore: refactor code for returning error message The idea now is to rely more on `net/http` and less on our own internal table. * chore: major code refactoring This essentially separates the actual API call from the translator bits, so we can now work on the extra nifty features we need. * feat: add simple function to return usage * feat: adding usage call * chore: refactor code to avoid object ambiguities New code requires passing structs representing JSON objects, instead of relying on loose interface conversions which may fail. Stricter is better! * chore: add help for languages * fix: add = to flag `type` usage line * feat: adding autocomplete files * doc: mentioned the autocompletion feature * fix: correctly display versions and build dates Note: I don’t know where the “builtBy” parameter comes from; currently, it needs to be force-pushed at bildtime with a -X tag to the linker. * chore: refactor more code, add option for glossary This was mostly meant as an experiment which can later be copied & pasted for other very similar options. apiCall() gained a new parameter, the method (because some things in the API stupidly use GET and not POST) * docs: better organise the explanatons, add links * chore: refactoring code — moving setup to “Before” * feat: add more flag support, upgrade dependencies * fix: revert changes: init must be done in main() I’ve attempted to do all initialisation chores under the “Before:” for the main cli.App loop. However, this wasn’t retrieving the data properly. Moving everything back to where it was in main(). * feat: major refactoring, we’ll get rid of settings In essence, we can use and reuse the DeepLClient type/object as the ‘de facto’ settings structure, we just need to find a way to read/save settings (possibly with cli-altsrv) * chore: adding ChatGPT-generated texts for testing * feat: adding support for (simple) debugging * test: test data in XML * docs: update README with latest changes * add readline package * fix: interactive prompt now works with readline * Update README.md Correction submitted by @coderabbitai Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * chore: upgrade to latest versions yadda yadda * Bug: fix expected error text for DEEPL_TOKEN I had changed the text in main.g0, but forgot to update it in main_test.go * Docs: add backticks on comments * Docs: changes suggested by @coderabbitai * Docs: comments ending with period * Fix: match correct error text (changed on main.go) * Bug: possible scoping issues with deeplToken (?) Not confirmed. But… this way we can be sure that it gets properly initialised and not scooped up into the “wrong” place… * Chore: bump year to 2024 * Fix: add timeout as per @coderabbitai suggestion * Fix: add try-catch as per @coderabbitai suggestion * Chore: add test for Exists; err.Error() is redundant … at least, when called with the text formatting functions derived from the `fmt` package. * Docs: add comment * Fix: check for edge case of empty string As suggested by @coderabbitai Also: return nil and not []string{}; we’re supposed to check for the `err` code, and nil is returned avoiding memory allocation of something that will never be used… * Chore: use http.StatusXXX instead of numbers It’s more idiomatic that way, even if not necessarily easier to read (everybody knows their HTTP error codes by heart, right? no? well, then perhaps it’s better to follow the usual practice of Go’s core developers…) * Bug: missing `)` * Bug: fix a testing bug The reason for it was that a potential JSON error was not being correctly caught; this was flagged by the test suite, and therefore I sort of fixed it. Now it correctly passes all tests it’s supposed to pass :) * Doc: fix stupid typo * Docs: add comment made by @coderabbitai Future TODO — have `Languages()` optionally reply in structured formats. * Fix: error checking for writing configuration file Caught by @coderabbitai --------- Co-authored-by: mochi-MizLab <mochice.mls.ntl@gmail.com> Co-authored-by: Osamu Takiya <takiya@toran.sakura.ne.jp> Co-authored-by: Omochice <44566328+Omochice@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
- Loading branch information