| # Copyright 2025 Google Inc. All Rights Reserved. |
| # |
| # Distributed under MIT license. |
| # See file LICENSE for detail or copy at https://opensource.org/licenses/MIT |
| |
| # Workflow for checking typos and buildifier, formatting, etc. |
| |
| name: "Lint" |
| |
| on: |
| push: |
| branches: [ "master" ] |
| pull_request: |
| branches: [ "master" ] |
| schedule: |
| - cron: '18 15 * * 0' |
| |
| permissions: |
| contents: read |
| |
| concurrency: |
| group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} |
| |
| jobs: |
| check: |
| name: Lint |
| runs-on: 'ubuntu-latest' |
| |
| steps: |
| |
| - name: Harden Runner |
| uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 |
| with: |
| egress-policy: audit |
| |
| - name: Checkout repository |
| uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 |
| |
| - name: Install tools |
| run: | |
| eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" |
| brew install buildifier ruff typos-cli |
| |
| - name: Check typos |
| run: | |
| eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" |
| ./scripts/check_typos.sh |
| |
| - name: Lint Python code |
| run: | |
| eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" |
| ruff check --extend-select=C4,C90,PERF,RET,SIM,W |
| |
| # TODO(eustas): run buildifier |