Home

Awesome

arcw

An engine which ensures ARC meet certain requirements.

Getting Started

To install arcw and validate the ARCs repository:

git clone git@github.com:algorandfoundation/arcw.git
cargo install --path=arcw arcw
arcw /path/to/ARCs
USAGE:
    arcw [OPTIONS] [SOURCES]...

ARGS:
    <SOURCES>...    Files and/or directories to check

OPTIONS:
        --format <FORMAT>     Output format [default: text] [possible values: text, json]
    -h, --help                Print help information
        --lints <LINTS>       Additional lints to enable
        --list-lints          List all available lints
        --no-default-lints    Do not enable the default lints

Demo

Example arc

---
arc: 2
description: A really short example of an arc.
title: Sample of an arc
author: Stéphane Barroso(@sudoweezy)
discussions-to: https://example.com/
status: Living
type: Meta
created: 2022-06-30
---

## Specification

Implementers of this arc must...

## Abstract

This is an abstract!

Output

error[markdown-order-section]: section `Specification` must come after `Motivation`
  --> /tmp/demo.md
   |
12 | ## Specification
   |
error[preamble-order]: preamble header `description` must come after `title`
 --> /tmp/demo.md
  |
3 | description: A really short example of an arc.
  |

Lints

idDescription
markdown-link-firstFirst mention of an arc must be a link.
markdown-link-statusarcs linked in the body have statuses further along than the current proposal.
markdown-order-sectionThere are no extra sections and the sections are in the correct order.
markdown-re-arc-dashOther arcs are referenced using ARC-X, not ARCX or ARC X.
markdown-re-arc-not-arcOther arcs are referenced using ARC-X, not arc-X.
markdown-rel-linksAll URLs in the page are relative.
markdown-req-sectionRequired sections are present in the body of the proposal.
preamble-authorThe author header is correctly formatted, and there is at least one GitHub user listed.
preamble-date-createdThe created header is a date.
preamble-date-last-call-deadlineThe last-call-deadline header is a date.
preamble-discussions-toThe discussions-to header is a valid URL.
preamble-arcThe arc header is a non-negative integer.
preamble-enum-categoryThe category header is a recognized value.
preamble-enum-statusThe status header is a recognized value.
preamble-enum-typeThe type header is a recognized value.
preamble-file-nameThe file name reflects the arc number.
preamble-len-descriptionThe description header isn't too long.
preamble-len-titleThe title header isn't too long.
preamble-list-authorThe author header is a correctly formatted comma-separated list.
preamble-list-requiresThe requires header is a correctly formatted comma-separated list.
preamble-no-dupThere are no duplicate headers.
preamble-orderThe preamble headers are in the correct order.
preamble-re-descriptionThe description doesn't contain "standard" or similar words.
preamble-re-description-arc-dasharcs referenced in the description header use a dash.
preamble-re-description-arcARCs referenced in the description header use the ARC-X format.
preamble-re-discussions-toThe discussions-to header points to algorandfoundation/ARCs/issues
preamble-re-titleThe title doesn't contain "standard" or similar words.
preamble-re-title-arc-dasharcs referenced in the title header use a dash.
preamble-re-title-arcARCs referenced in the title header use the ARC-X format.
preamble-reqAll required preamble headers are present.
preamble-req-categoryThe category header is present only when required.
preamble-req-last-call-deadlineThe last-call-deadline header is present only when required.
preamble-req-withdrawal-reasonThe withdrawal-reason header is present only when required.
preamble-req-deprecated-reasonThe deprecated-reason header is present only when required.
preamble-requires-ref-descriptionProposals mentioned in the description header appear in the requires header.
preamble-requires-ref-titleProposals mentioned in the title header appear in the requires header.
preamble-requires-statusarcs listed in requires have statuses further along than the current proposal.
preamble-trimThere is no extra whitespace around preamble fields.
preamble-uint-requiresThe requires header is a sorted list of non-negative integers.

JavaScript / WebAssembly

arcw-lint-js packages arcw as an npm package, for use in JavaScript / TypeScript.

You can find the package on npm.

Building & Publishing

cd arcw-lint-js
wasm-pack test --node
wasm-pack build -t nodejs
wasm-pack publish -t nodejs

This tool is an adaptation of (EIPW)[https://github.com/ethereum/eipw]