https://gitlab.com/tezos/tezos
Raw File
Tip revision: 81301dd08ec57b85f9a09e61de488f3960135dfb authored by Arvid Jakobsson on 28 March 2024, 11:34:37 UTC
CIAO: remove functions for writing external jobs
Tip revision: 81301dd
README.md
# Linting via semgrep

This directory includes rules for linting the OCaml source code of Octez.


## Usage

After [installing semgrep](https://semgrep.dev/docs/getting-started/) simply
execute

```
make check-ocaml-linting
```

This command will analyse all the relevant files and will purposefully ignore
files such as already hashed protocols.

Alternatively, if you want to test only the library you are currently working
on, say, `src/lib_validation`, you can execute

```
semgrep --metrics=off --error --lang ocaml --config scripts/semgrep/ src/lib_validation/
```

## CI

The CI also performs linting checks. Note that, to avoid issues related to
changes in `semgrep`, the CI uses a fixed version of the tool. If you need to
run the same version locally you need to install `docker` and then run

```
docker run --rm -v "${PWD}:/src" returntocorp/semgrep-agent:sha-c6cd7cf --metrics=off --error -l ocaml -c scripts/semgrep/ --exclude "src/proto_[0-9]*/lib_protocol/*.ml*" src/
```

This command has the exact same output as the CI, no matter what updates have
been pushed to the upstream tool.


## Rules

This directory contains our own in-house rules.
back to top