| 1 | The goals and overview of this package can be found in the README.md file, |
| 2 | start by reading that. |
| 3 | |
| 4 | The goal of this package is to determine the display (column) width of a |
| 5 | string, UTF-8 bytes, or runes, as would happen in a monospace font, especially |
| 6 | in a terminal. |
| 7 | |
| 8 | When troubleshooting, write Go unit tests instead of executing debug scripts. |
| 9 | The tests can return whatever logs or output you need. If those tests are |
| 10 | only for temporary troubleshooting, clean up the tests after the debugging is |
| 11 | done. |
| 12 | |
| 13 | (Separate executable debugging scripts are messy, tend to have conflicting |
| 14 | dependencies and are hard to cleanup.) |
| 15 | |
| 16 | If you make changes to the trie generation in internal/gen, it can be invoked |
| 17 | by running `go generate` from the top package directory. |
| 18 | |
| 19 | ## Pull Requests and branches |
| 20 | |
| 21 | For PRs (pull requests), you can use the gh CLI tool. Compare the current branch with main. Reviewing a PR and reviewing a branch are about the same, but the PR may add context. |
| 22 | |
| 23 | Understand the goals of the PR. Note any API changes, especially breaking changes. |
| 24 | |
| 25 | Look for thoroughness of tests, as well as GoDoc comments. |
| 26 | |
| 27 | Retrieve and consider the comments on the PR, which may have come from GitHub Copilot or Cursor BugBot. Think like GitHub Copilot or Cursor BugBot. |
| 28 | |
| 29 | Offer to optionally post a brief summary of the review to the PR, via the gh CLI tool. |
| 30 | |
| 31 | ## Tagged Go releases |
| 32 | |
| 33 | If I ask you whether we are ready to release, this means a tagged Go release on the main branch. Go releases are git tagged with a version number. |
| 34 | |
| 35 | Review the changes since the last release, i.e. the previous git tag. Ensure that the changes are complete and correct. Identify new features, bug fixes, and performance improvements. |
| 36 | |
| 37 | Identify breaking changes, especially API changes. |
| 38 | |
| 39 | Ensure good test coverage. Look for performance changes, especially performance regressions, by running benchmarks against the previous release. |
| 40 | |
| 41 | Ensure that the documentation in READMEs and GoDocs are complete, correct and consistent. |
| 42 | |
| 43 | ## Comparisons to go-runewidth |
| 44 | |
| 45 | We originally attempted to make this package compatible with go-runewidth. |
| 46 | However, we found that there were too many differences in the handling of |
| 47 | certain characters and properties. |
| 48 | |
| 49 | We believe, preliminarily, that our choices are more correct and complete, |
| 50 | by using more complete categories such as Unicode Cf (format) for zero-width |
| 51 | and Mn (Nonspacing_Mark) for combining marks. |