From 320fbea9b9d46f4cfe3885717a4b6aba4e989e2d Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 11 Mar 2022 14:52:31 -0500 Subject: [PATCH] Document datalog linter introduced in #4503 --- docs/dev-practices.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/dev-practices.md b/docs/dev-practices.md index 51aef5df78..cc8e5914f4 100644 --- a/docs/dev-practices.md +++ b/docs/dev-practices.md @@ -51,6 +51,13 @@ scripts/large_vars.clj To configure the linter, see its `config` var. +### Datalog linting + +We use [datascript](https://github.com/tonsky/datascript)'s datalog to power our modeling and querying layer. Since datalog is concise, it is easy to write something invalid. To avoid typos and other preventable mistakes, we lint our queries and rules. Our queries are linted through clj-kondo and [datalog-parser](https://github.com/lambdaforge/datalog-parser). clj-kondo will error if it detects an invalid query. Our rules are linted through a script that also uses the datalog-parser. To run this linter: +``` +scripts/lint_rules.clj +``` + ## Testing We have unit and end to end tests.