typos/CONTRIBUTING.md
Martin Fischer 967d6d751e docs(contrib): Move description of SNAPSHOTS=overwrite to right step
This text was apparently accidentally moved in
7eb8873950.
2023-08-11 13:36:28 +02:00

3.7 KiB

Contributing to typos

Thanks for wanting to contribute! There are many ways to contribute and we appreciate any level you're willing to do.

Feature Requests

Need some new functionality to help? You can let us know by opening an issue. It's helpful to look through all issues in case its already being talked about.

Bug Reports

Please let us know about what problems you run into, whether in behavior or ergonomics of API. You can do this by opening an issue. It's helpful to look through all issues in case its already being talked about.

Pull Requests

Looking for an idea? Check our issues. If it's look more open ended, it is probably best to post on the issue how you are thinking of resolving the issue so you can get feedback early in the process. We want you to be successful and it can be discouraging to find out a lot of re-work is needed.

Already have an idea? It might be good to first create an issue to propose it so we can make sure we are aligned and lower the risk of having to re-work some of it and the discouragement that goes along with that.

Updating the Dictionary

typos dictionary is a mapping of typos to a list of possible corrections (see Design).

If you aren't in a hurry, we have a pinned Issue to collect dictionary changes to be done in bulk in an attempt to lower the barrier for improving the dictionary.

Otherwise, to add to the dictionary:

  1. Add your typo to our data file crates/typos-dict/assets/words.csv

Format: typo,correction[,correction...]

  1. Code-gen the dictionary

With cargo and rustfmt installed, run

$ SNAPSHOTS=overwrite cargo test --workspace

(we do development-time code-gen to speed up builds)

Auto-cleans up your change according to some rules we have like:

  • Don't prefer specific dialects in the dictionary, leaving those to varcon.
  • Mixing up corrections and typos
  • etc
  1. Verify your change

Run

$ cargo test --workspace

Process

When you first post a PR, we request that the commit history get cleaned up. We recommend avoiding this during the PR to make it easier to review how feedback was handled. Once the commit is ready, we'll ask you to clean up the commit history. Once you let us know this is done, we can move forward with merging! If you are uncomfortable with these parts of git, let us know and we can help.

We ask that all new files have the copyright header. Please update the copyright year for files you are modifying.

As a heads up, we'll be running your PR through the following gauntlet:

Check out our CI for more information.

Releasing

When we're ready to release, a project owner should do the following

  • Determine what the next version is, according to semver
  • Bump version in a commit
    • Update CHANGELOG.md
    • Update the version in Cargo.toml
    • Update the dependency version in src/lib.rs
    • Update the dependency version in README.md
  • Tag the commit via git tag -am "v<X>.<Y>.<Z>" v<X>.<Y>.<Z>
  • git push upstream master --tag v<X>.<Y>.<Z>
  • Run cargo publish (run cargo login first if needed)