Bylaw is an Elixir library for validating code, database, query, schema, and rendered HTML constraints.
Bylaw is organized as independent packages under packages/:
Packages most applications start with:
packages/bylaw_htmlvalidates rendered HTML strings with explicit checks.packages/bylaw_ecto_queryvalidates prepared Ecto queries.packages/bylaw_postgresvalidates Postgres database structure and schema conventions.packages/bylaw_credoprovides custom Credo checks for downstream development and test environments.
Supporting packages used by Bylaw itself:
packages/bylaw_coredefines shared core helpers used by Bylaw packages.packages/bylaw_dbdefines generic database check contracts and data structures.
Add the package you need to your dependencies:
def deps do
[
{:bylaw_html, "~> 0.1.0-alpha.2", only: :test},
{:bylaw_ecto_query, "~> 0.3.0"},
{:bylaw_postgres, "~> 0.3.0"},
{:bylaw_credo, "~> 0.2.0", only: [:dev, :test], runtime: false}
]
endEach package has its own mix.exs. Run package-specific commands from the
package directory:
cd packages/bylaw_ecto_query
mix testTo run the standard checks across all packages from the repository root:
scripts/qa.sh