Skip to content

Commit

Permalink
ci: use dedicated lint workflow to verify formatting (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm authored Apr 17, 2024
1 parent 179a64d commit 0702249
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 12 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/analyzer_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,3 @@ jobs:
# TODO: include Windows
if: runner.os != 'Windows'
run: v .github/workflows/version_test.vv

- name: Verify formatting
shell: bash
run: |
set +e
v fmt -c .
exit_code=$?
# Don't fail on internal errors.
if [[ $exit_code -ne 0 && $exit_code -ne 5 ]]; then
v fmt -diff .
exit 1
fi
40 changes: 40 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Lint

on:
push:
paths:
- '**.v'
- '**/lint.yml'
pull_request:
paths:
- '**.v'
- '**/lint.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

jobs:
fmt:
runs-on: ubuntu-20.04

steps:
- name: Install V
id: install-v
uses: vlang/[email protected]
with:
check-latest: true

- name: Checkout v-analyzer
uses: actions/checkout@v4

- name: Verify formatting
run: |
set +e
v fmt -c .
exit_code=$?
# Don't fail on internal errors.
if [[ $exit_code -ne 0 && $exit_code -ne 5 ]]; then
v fmt -diff .
exit 1
fi

0 comments on commit 0702249

Please sign in to comment.