Skip to content
/ yalo Public

A plugin-based linting platform for OCaml and maybe other languages. Because it is a platform, it comes with only few rules, only as examples.

License

Notifications You must be signed in to change notification settings

OCamlPro/yalo

Repository files navigation

Actions Status Release

yalo

Logo

Yalo aims at providing a code scanner for OCaml projects. Because most organizations want to easily add their own linting rules, Yalo is plugin-based, it provides a simple to use interface to easily write such plugins. Projects can easily be configured to use Yalo, activate the warnings/errors that they want, and integrate the tool in Github Actions thanks to SARIF JSON output.

FAQ:

  • How to configure a project ?

At the project root:

touch .yaloconf
yalo lint --save-config .yaloconf

will create a default .yaloconf file that you can improve.

  • How to integrate in Github workflows ?

In your .github/workflows Yaml files, you can add the following sections:

For permissions:

    permissions:
      contents: write
      security-events: write
      actions: read

In the workflow (typically before or after tests):

      - name: Run Yalo with SARIF output
        run: |
	  opam exec -- yalo lint --message-format sarif > yalo.sarif
        if: matrix.os != 'windows-latest'

      - name: Upload SARIF file
        uses: github/codeql-action/upload-sarif@v3
        if: matrix.os != 'windows-latest'
        with:
          sarif_file:  yalo.sarif
          category: yalo-lint
  • How to improve pretty-printing of yalo errors ?

Yalo can output messages in SARIF JSON format, using --message-format=sarif. You can then use tools for this format, such as sarif-fmt:

yalo lint --message-format=sarif | sarif-fmt
  • When I execute yalo and compile a local plugin, the execution always fails with a Dynlink.Inconsistent_implementation ?

Check that the compiler that you are using is the one that was used to compile yalo. You may need to change the opam switch for example.

About

A plugin-based linting platform for OCaml and maybe other languages. Because it is a platform, it comes with only few rules, only as examples.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published