Skip to content

Commit

Permalink
Merge pull request #44 from trailofbits/mschwager-contributing-linting
Browse files Browse the repository at this point in the history
Fix #43, add linting process to CONTRIBUTING
  • Loading branch information
mschwager committed Jan 24, 2024
2 parents 92e7cb4 + cc43a20 commit 14898d8
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -70,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

Expand Down

0 comments on commit 14898d8

Please sign in to comment.