Skip to content

Commit 6d82ed7

Browse files
committed
feat: enforce Dafny formatting
1 parent 56f1cd1 commit 6d82ed7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+4384
-4316
lines changed

.github/workflows/library_format.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# This workflow performs static analysis checks.
2+
name: Library format check
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
dafny:
8+
description: "The Dafny version to run"
9+
required: true
10+
type: string
11+
12+
jobs:
13+
format_projects:
14+
# Don't run the nightly build on forks
15+
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
16+
strategy:
17+
matrix:
18+
library:
19+
[
20+
DynamoDbEncryption,
21+
]
22+
os: [ubuntu-latest]
23+
runs-on: ${{ matrix.os }}
24+
defaults:
25+
run:
26+
shell: bash
27+
env:
28+
DOTNET_CLI_TELEMETRY_OPTOUT: 1
29+
DOTNET_NOLOGO: 1
30+
steps:
31+
- name: Support longpaths
32+
run: |
33+
git config --global core.longpaths true
34+
35+
- uses: actions/checkout@v4
36+
# The specification submodule is private so we don't have access, but we don't need
37+
# it to verify the Dafny code. Instead we manually pull the submodule we DO need.
38+
# - run: git submodule update --init libraries
39+
# - run: git submodule update --init smithy-dafny
40+
41+
- name: Setup Dafny
42+
uses: dafny-lang/[email protected]
43+
with:
44+
dafny-version: ${{ inputs.dafny }}
45+
46+
- name: Check format of ${{ matrix.library }} Dafny code
47+
working-directory: ./${{ matrix.library }}
48+
run: |
49+
# This works because `node` is installed by default on GHA runners
50+
CORES=$(node -e 'console.log(os.cpus().length)')
51+
make format_dafny-check

0 commit comments

Comments
 (0)