Visualize.Audit.Spelling (Visualize v0.7.0)

Copy Markdown View Source

American spelling in everything this library names and writes (spec/12 §3, #642, D-183).

Fails on a British form — colour, centre, grey, -ise, -our, -elled, metre and the rest — in lib/, test/, specs/, spec/, guides/, README.md, the CHANGELOG's unreleased entries and the examples app, inside identifiers as well as prose, so recolour_all is caught as surely as "a colour".

What stays British is an allowlist, not a judgment call:

  • Elixir's own behaviour — @behaviour, a Behaviour module, and prose about a module contract ("implements this behaviour");
  • quoted third-party text — CSS's grey keywords, d3's Greys scheme, ARIA's aria-labelledby, the metre unit alias a host may type, and metresis, a project's name;
  • the CHANGELOG's released entries, which say what each release was called;
  • a line marked spelling: allow — a comment line so marked allows the line after it too, an old name a migration reads — and a Markdown region between lines that are <!-- spelling: allow --> and <!-- spelling: end -->.

Summary

Functions

The British words of one file's text, as file:line: word strings. The CHANGELOG is read up to its first released entry.

Problems across the scanned trees under root; [] when every word is American.

Functions

check(text, file)

@spec check(String.t(), String.t()) :: [String.t()]

The British words of one file's text, as file:line: word strings. The CHANGELOG is read up to its first released entry.

iex> Visualize.Audit.Spelling.check("a gray line\n", "lib/x.ex")
[]

run(root)

@spec run(String.t()) :: [String.t()]

Problems across the scanned trees under root; [] when every word is American.