From c7c21b7ac9c8ef5bb89dc154a2118f955ec5572c Mon Sep 17 00:00:00 2001 From: Matt Schwager Date: Tue, 16 Jan 2024 09:58:47 -0700 Subject: [PATCH 1/2] Fix #43, add linting process to CONTRIBUTING --- CONTRIBUTING.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7243d8a..4b82430 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,7 +26,19 @@ Then [install semgrep CLI](https://semgrep.dev/docs/getting-started/), and you a ### Linting -Currenty we don't use any linting tools. In the future we plan to use `yamlfmt`. +First, [install `prettier`](https://prettier.io/docs/en/install), or [use `brew`](https://formulae.brew.sh/formula/prettier) to do so. + +Use the following command to check rule files for formatting errors: + +```bash +prettier --check '**/*.{yaml,yml}' +``` + +Any issues can be automatically fixed with the following command: + +```bash +prettier --write '**/*.{yaml,yml}' +``` ### Testing From cc43a202a3503f1c45d50597d9c39014e2cb667f Mon Sep 17 00:00:00 2001 From: Maciej Domanski <38883201+ahpaleus@users.noreply.github.com> Date: Wed, 17 Jan 2024 09:30:31 +0100 Subject: [PATCH 2/2] Update CONTRIBUTING.md --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4b82430..1a8a214 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -82,6 +82,7 @@ Before publishing a new rule, or updating an existing one, make sure to review t - [ ] Use `>-` for multiline messages - [ ] Use backticks in messages e.g., `$VAR`, `$FUNC`, `some.method()` - The `languages` field in `[go, java]` format are preferable (not `- go \n -java`) + - [ ] Run prettier (see [Linting](#linting)) - [ ] Check amount of false-positives on some large public repositories