MCPcopy Index your code
hub / github.com/chipsalliance/verible-linter-action

github.com/chipsalliance/verible-linter-action @v2.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.0 ↗ · + Follow
21 symbols 44 edges 2 files 10 documented · 48%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Verible Linter Action

This action uses Verible to identify coding style issues in SystemVerilog code.

verible linter action

Usage

See 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 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:

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, a config file, Verible version and extra arguments for verible-verilog-lint.

- 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"
    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. In order to have automatic reviews on external PRs, you need to create two workflows. One will be triggered on pull_request and upload the data needed by reviewdog as an artifact. The artifact shall store the file pointed by $GITHUB_EVENT_PATH as event.json. The other workflow will download the artifact and use the Verible action.

For example:

name: upload-event-file
on:
  pull_request:

...
      - run: cp "$GITHUB_EVENT_PATH" ./event.json
      - name: Upload event file as artifact
        uses: actions/upload-artifact@v2
        with:
          name: event.json
          path: event.json
name: review-triggered
on:
  workflow_run:
    workflows: ["upload-event-file"]
    types:
      - completed

jobs:
  review_triggered:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: 'Download artifact'
        id: get-artifacts
        uses: actions/github-script@v3.1.0
        with:
          script: |
            var artifacts = await github.actions.listWorkflowRunArtifacts({
               owner: context.repo.owner,
               repo: context.repo.repo,
               run_id: ${{github.event.workflow_run.id }},
            });
            var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
              return artifact.name == "event.json"
            })[0];
            var download = await github.actions.downloadArtifact({
               owner: context.repo.owner,
               repo: context.repo.repo,
               artifact_id: matchArtifact.id,
               archive_format: 'zip',
            });
            var fs = require('fs');
            fs.writeFileSync('${{github.workspace}}/event.json.zip', Buffer.from(download.data));
      - run: |
          unzip event.json.zip
      - name: Run Verible action with Reviewdog
        uses: chipsalliance/verible-linter-action@main
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}

Core symbols most depended-on inside this repo

fix
called by 1
rdf_gen.py
as_rdf_dict
called by 1
rdf_gen.py
error_messages_to_rdf
called by 1
rdf_gen.py
read_efm
called by 1
rdf_gen.py
read_diff
called by 1
rdf_gen.py
apply_fixes
called by 1
rdf_gen.py
main
called by 1
rdf_gen.py
recursive_find
called by 1
action.py

Shape

Function 11
Method 6
Class 2
Route 2

Languages

Python100%

Modules by API surface

rdf_gen.py14 symbols
action.py7 symbols

For agents

$ claude mcp add verible-linter-action \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page