https://github.com/chipsalliance/verible-linter-action
Automatic SystemVerilog linting in github actions with the help of Verible
https://github.com/chipsalliance/verible-linter-action
Last synced: 7 months ago
JSON representation
Automatic SystemVerilog linting in github actions with the help of Verible
- Host: GitHub
- URL: https://github.com/chipsalliance/verible-linter-action
- Owner: chipsalliance
- License: apache-2.0
- Created: 2021-08-24T09:00:32.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-23T07:37:41.000Z (about 1 year ago)
- Last Synced: 2025-04-02T02:26:41.965Z (8 months ago)
- Language: Python
- Homepage:
- Size: 49.8 KB
- Stars: 33
- Watchers: 10
- Forks: 14
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- fucking-static-analysis - verible-linter-action
- static-analysis - verible-linter-action
README
# Verible Linter Action
This action uses [Verible](https://github.com/chipsalliance/verible) to identify coding style issues in SystemVerilog code.

## Usage
See [action.yml](action.yml)
This is a GitHub Action used to lint Verilog and SystemVerilog source files
and comment erroneous lines of code in Pull Requests automatically.
The GitHub Token input is used to provide
[reviewdog](https://github.com/reviewdog/reviewdog)
access to the PR.
If you don't wish to use the automatic PR review,
you can omit the ``github_token`` input.
If you'd like to use a reporter of reviewdog other than ``github-pr-review``,
you can pass its name in the input ``reviewdog_reporter``.
If you want to declare Verible version to be used,
you can pass its release tag in the input ``verible_version``.
Here's a basic example to lint all ``*.v`` and ``*.sv`` files:
```yaml
name: Verible linter example
on:
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: chipsalliance/verible-linter-action@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
```
You can provide optional arguments to specify paths, exclude paths, extensions of tested files,
a config file, Verible version and extra arguments for ``verible-verilog-lint``.
```yaml
- uses: chipsalliance/verible-linter-action@main
with:
config_file: 'config.rules'
paths: |
./rtl
./shared
exclude_paths: |
./rtl/some_file
extra_args: "--check_syntax=true"
verible_version: "v0.0-3100-gd75b1c47"
extensions: |
.sv
.v
.vh
.svh
github_token: ${{ secrets.GITHUB_TOKEN }}
```
## Automatic review on PRs from external repositories
In GitHub Actions, workflows triggered by external repositories may only have
[read access to the main repository](https://docs.github.com/en/actions/reference/authentication-in-a-workflow#permissions-for-the-github_token).
In order to have automatic reviews on external PRs, you need to change your workflow to trigger
on ``pull_request_target`` event and manually check out changes from pull request:
```yaml
name: Verible linter example
on:
pull_request_target:
jobs:
lint:
runs-on: ubuntu-latest
permissions:
checks: write
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Run Verible action
uses: chipsalliance/verible-linter-action@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
```