Skip to content

Commit

Permalink
chore: add linting to avm-transpiler CI (#6732)
Browse files Browse the repository at this point in the history
This PR adds linting and formatting to the AVM transpiler's CI checks.
My main reasoning for this is that I noticed in #6730 that we're pulling
in the whole of the Noir compiler for some reason but not actually using
it, this could have been caught with clippy lints.

I've also copied across the `.rustfmt.toml` from Noir as this prevents
some shorter lines being split over multiple lines (which improves
readability imo). Happy to revert this change if it's unwanted.
  • Loading branch information
TomAFrench authored May 29, 2024
1 parent 9e8cba1 commit 57864f9
Show file tree
Hide file tree
Showing 9 changed files with 161 additions and 1,121 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
pull-requests: read
# Set job outputs to values from filter step
outputs:
avm-transpiler: ${{ steps.filter.outputs.avm-transpiler }}
barretenberg: ${{ steps.filter.outputs.barretenberg }}
barretenberg-cpp: ${{ steps.filter.outputs.barretenberg-cpp }}
noir: ${{ steps.filter.outputs.noir }}
Expand All @@ -61,6 +62,8 @@ jobs:
- 'barretenberg/cpp/**'
noir:
- 'noir/**'
avm-transpiler:
- 'avm-transpiler/**'
l1-contracts:
- 'l1-contracts/**'
noir-projects:
Expand Down Expand Up @@ -419,6 +422,21 @@ jobs:
timeout-minutes: 40
run: earthly-ci --no-output ./noir-projects/+test

avm-format:
needs: [setup, changes]
runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86
if: ${{ needs.changes.outputs.avm-transpiler == 'true' || needs.changes.outputs.noir == 'true' }}
steps:
- uses: actions/checkout@v4
with: { ref: "${{ env.GIT_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: avm-transpiler-format-x86
- name: "Format AVM transpiler"
working-directory: ./avm-transpiler/
timeout-minutes: 40
run: earthly-ci --no-output ./+format

yarn-project-formatting:
needs: build
runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86
Expand Down Expand Up @@ -631,6 +649,7 @@ jobs:
- noir-examples
- noir-packages-test
- noir-projects
- avm-format
- yarn-project-formatting
- yarn-project-test
- prover-client-test
Expand Down Expand Up @@ -680,6 +699,7 @@ jobs:
- noir-examples
- noir-packages-test
- noir-projects
- avm-format
- yarn-project-formatting
- yarn-project-test
- prover-client-test
Expand Down
2 changes: 2 additions & 0 deletions avm-transpiler/.rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
edition = "2018"
use_small_heuristics = "Max"
Loading

0 comments on commit 57864f9

Please sign in to comment.