Rulesets
A ruleset is a file in your .rules
folder. You can have lots of checks in a ruleset. For example:
Make sure our migrations follow these rules:
1. make sure that all tables have a created_at
2. make sure migrations don't have breaking changes. For example, removing a table, removing column, and so on. It's okay to have a breaking change if there's a comment on the migration that explains why it's safe to have that change.
3. prefer 'uuid' primary keys over 'id' primary keys
Filtering files
You can make a Ruleset apply only to particular files with frontmatter, like the following:
---
include: ["**/migrations/**"]
---
Make sure our migrations follow these rules:
1. ...
Example: Just Typescript files
---
include: ["**/*.ts", "**/*.tsx"]
---
I only apply to your TypeScript files!
Example: A specific file
---
include: ["**/migrations/2020-01-01-create-users-table.sql"]
---
I only apply to your 2020-01-01-create-users-table.sql file!