Canvas lint
Easol has developed and maintains a gem called easol-canvas, which is used for validating Easol themes (See RubyGems or GitHub).
The canvas lint
command will run the following validation checks:
- RequiredFilesCheck
- Checks that the required files exist and are not empty:
- templates/product/index
- templates/blog_overview/index
- templates/blog_post/index
- partials/footer/index
- partials/menu/index
- assets/index.css
- Checks that the required files exist and are not empty:
- ValidHtmlCheck
- Validates all
.html
files contain valid HTML.
- Validates all
- ValidLiquidCheck
- Validates all
.html
and.liquid
files contain valid Liquid.
- Validates all
- ValidJsonCheck
- Validates all
.json
files contain valid JSON.
- Validates all
- ValidSassCheck
- Validates all
.css
,.scss
and.sass
files contain valid SASS.
- Validates all
- ValidBlockSchemasCheck
- Validates the schema defined in the front matter within each block template
- Correctly formatted
- For each attribute, the required key (type) is present
- All keys are valid, and types exist
- Validates the schema defined in the front matter within each block template
- ValidMenuSchemaCheck
- Validates the schema in partials/menu/index.html
- ValidFooterSchemaCheck
- Validates the schema in partials/footer/index.html
- ValidCustomTypesCheck
- Validates all custom types are valid with valid attribute definitions
Usage
To use the gem locally, you can install it and use the canvas lint
command in the root of your theme directory:
gem install easol-canvas
canvas lint
There is a canvas-linter-action, which should be set up inside a theme repo to run validations on each push.