Fill a gap in a library
Implement a utility in a library that does not have it yet, or start a library in a new language.
The parity matrix shows every gap. The page of each library, for example Python, lists what that library is missing. Each gap is a separate contribution. The rule and the test cases already exist. Usually, the library repository already has an issue titled Implement <function> with the reference code and the test cases.
Add a utility to a library
-
Read the utility page. The spec and the test cases define the full behavior. The tabs of the other libraries show their code.
-
Implement the function. Follow the library's contributing guide. Use the names that the language expects, for example
isValidCpf,is_valid_cpforcpf.IsValid. The contract does not set the names. The validator finds a function by its name, or by a binding inlibs/<lib>.json. -
Register the function in the harness of the library. The harness reads the copy of
api-contract/cases/*.jsonin the library. It runs every case of every function it knows, with the library's own test command. -
Add the usage example to
docs/usage/<util>.md. The usage files page describes the format.docs usage --scaffoldwrites the example from the cases that the library passes. -
Release. The next run of the docs pipeline closes the issue. The next build of this site shows the new tab and the new status.
Start a library in a new language
-
Ask the organization for a repository at
brazilian-utils/<language>. -
In docs, add a language adapter and
libs/brazilian-utils-<language>.json. The adapter reads the API and runs the tests. The JSON file has asiteblock with the label, the icon, the install command and the registry link. docs/adding-a-language.md shows each step. -
Start with the core functions.
docs issues --backfill core --lib <language> --applyopens one issue for each missing core function. -
Add the harness to the library, as docs/harness.md shows. Publish
docs/usage/from the first release.
Do not document behavior that differs from the other libraries. If an implementation does not match the contract, fix the failing case, or propose a change to the contract.
Last updated on
