Skip to content

Commit

Permalink
chore: format all code (#110)
Browse files Browse the repository at this point in the history
update formatting use prettier for yaml, java, md

run `make format_java_misc`
  • Loading branch information
seebees authored Oct 27, 2023
1 parent c5f8b02 commit d6d887c
Show file tree
Hide file tree
Showing 301 changed files with 27,419 additions and 11,648 deletions.
8 changes: 3 additions & 5 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
*Issue #, if available:*
_Issue #, if available:_

*Description of changes:*

*Squash/merge commit message, if applicable:*
_Description of changes:_

_Squash/merge commit message, if applicable:_

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

2 changes: 1 addition & 1 deletion .github/workflows/ci_static-analysis.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow performs static analysis checks.
name: static analysis

on:
on:
pull_request:
push:
branches:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dafny_version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ jobs:
id: read_property
uses: christian-draeger/[email protected]
with:
path: './project.properties'
properties: 'dafnyVersion'
path: "./project.properties"
properties: "dafnyVersion"
2 changes: 1 addition & 1 deletion .github/workflows/duvet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# with respect to the specification
name: Duvet report

on:
on:
pull_request:
push:
branches:
Expand Down
23 changes: 12 additions & 11 deletions .github/workflows/library_dafny_verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,23 @@ on:
workflow_call:
inputs:
dafny:
description: 'The Dafny version to run'
description: "The Dafny version to run"
required: true
type: string
jobs:
verification:
strategy:
matrix:
library: [
TestVectorsAwsCryptographicMaterialProviders,
AwsCryptographyPrimitives,
ComAmazonawsKms,
ComAmazonawsDynamodb,
AwsCryptographicMaterialProviders,
StandardLibrary,
]
os: [ macos-latest-large ]
library:
[
TestVectorsAwsCryptographicMaterialProviders,
AwsCryptographyPrimitives,
ComAmazonawsKms,
ComAmazonawsDynamodb,
AwsCryptographicMaterialProviders,
StandardLibrary,
]
os: [macos-latest-large]
runs-on: ${{ matrix.os }}
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
Expand All @@ -45,7 +46,7 @@ jobs:
- name: Setup .NET Core SDK '6.0.x'
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
dotnet-version: "6.0.x"

- name: Verify ${{ matrix.library }} Dafny code
shell: bash
Expand Down
59 changes: 33 additions & 26 deletions .github/workflows/library_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,26 @@ on:
workflow_call:
inputs:
dafny:
description: 'The Dafny version to run'
description: "The Dafny version to run"
required: true
type: string

jobs:
format:
format_projects:
# Don't run the nightly build on forks
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
strategy:
matrix:
library: [
AwsCryptographyPrimitives,
ComAmazonawsKms,
ComAmazonawsDynamodb,
AwsCryptographicMaterialProviders,
TestVectorsAwsCryptographicMaterialProviders,
StandardLibrary,
]
os: [ ubuntu-latest ]
library:
[
AwsCryptographyPrimitives,
ComAmazonawsKms,
ComAmazonawsDynamodb,
AwsCryptographicMaterialProviders,
TestVectorsAwsCryptographicMaterialProviders,
StandardLibrary,
]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
Expand Down Expand Up @@ -51,19 +52,25 @@ jobs:
CORES=$(node -e 'console.log(os.cpus().length)')
make format_dafny-check
# Commented out until the format has been updated
# - name: Check format of ${{ matrix.library }} Net code
# shell: bash
# working-directory: ./${{ matrix.library }}
# run: |
# # This works because `node` is installed by default on GHA runners
# CORES=$(node -e 'console.log(os.cpus().length)')
# make format_net-check
- name: Check format of ${{ matrix.library }} Net code
shell: bash
working-directory: ./${{ matrix.library }}
run: |
# This works because `node` is installed by default on GHA runners
CORES=$(node -e 'console.log(os.cpus().length)')
make format_net-check
format_java_misc:
# Don't run the nightly build on forks
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
runs-on: ubuntu-latest

# - name: Check format of ${{ matrix.library }} Java code
# shell: bash
# working-directory: ./${{ matrix.library }}
# run: |
# # This works because `node` is installed by default on GHA runners
# CORES=$(node -e 'console.log(os.cpus().length)')
# make format_java-check
steps:
- name: Support longpaths
run: |
git config --global core.longpaths true
- uses: actions/checkout@v2
- name: Check format of Java, yaml, and md
shell: bash
run: |
make setup_prettier
make format_java_misc-check
51 changes: 26 additions & 25 deletions .github/workflows/library_java_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,29 @@ on:
workflow_call:
inputs:
dafny:
description: 'The Dafny version to run'
description: "The Dafny version to run"
required: true
type: string

jobs:
testJava:
strategy:
matrix:
library: [
AwsCryptographyPrimitives,
ComAmazonawsKms,
ComAmazonawsDynamodb,
AwsCryptographicMaterialProviders,
TestVectorsAwsCryptographicMaterialProviders,
StandardLibrary,
]
library:
[
AwsCryptographyPrimitives,
ComAmazonawsKms,
ComAmazonawsDynamodb,
AwsCryptographicMaterialProviders,
TestVectorsAwsCryptographicMaterialProviders,
StandardLibrary,
]
os: [
# TODO just test on mac for now
# windows-latest,
ubuntu-latest,
macos-latest
]
# TODO just test on mac for now
# windows-latest,
ubuntu-latest,
macos-latest,
]
runs-on: ${{ matrix.os }}
permissions:
id-token: write
Expand Down Expand Up @@ -57,8 +58,8 @@ jobs:
- name: Setup Java 8
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: 8
distribution: "corretto"
java-version: 8

- name: Build ${{ matrix.library }} implementation
shell: bash
Expand All @@ -76,15 +77,15 @@ jobs:
- name: Setup Java 11
uses: actions/setup-java@v3
with:
distribution: 'corretto'
distribution: "corretto"
java-version: 11

- name: Clean for next Java
uses: gradle/gradle-build-action@v2
with:
arguments: clean
build-root-directory: ./${{ matrix.library }}/runtimes/java
build-root-directory: ./${{ matrix.library }}/runtimes/java

- name: Compile Java 11
uses: gradle/gradle-build-action@v2
with:
Expand All @@ -96,11 +97,11 @@ jobs:
with:
arguments: runTests
build-root-directory: ./${{ matrix.library }}/runtimes/java

- name: Setup Java 16
uses: actions/setup-java@v3
with:
distribution: 'corretto'
distribution: "corretto"
java-version: 16

- name: Clean for next Java
Expand All @@ -119,12 +120,12 @@ jobs:
uses: gradle/gradle-build-action@v2
with:
arguments: runTests
build-root-directory: ./${{ matrix.library }}/runtimes/java
build-root-directory: ./${{ matrix.library }}/runtimes/java

- name: Setup Java 17
uses: actions/setup-java@v3
with:
distribution: 'corretto'
distribution: "corretto"
java-version: 17

- name: Clean for next Java
Expand All @@ -143,4 +144,4 @@ jobs:
uses: gradle/gradle-build-action@v2
with:
arguments: runTests
build-root-directory: ./${{ matrix.library }}/runtimes/java
build-root-directory: ./${{ matrix.library }}/runtimes/java
31 changes: 14 additions & 17 deletions .github/workflows/library_net_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,25 @@ on:
workflow_call:
inputs:
dafny:
description: 'The Dafny version to run'
description: "The Dafny version to run"
required: true
type: string

jobs:
testDotNet:
strategy:
matrix:
library: [
StandardLibrary,
AwsCryptographyPrimitives,
ComAmazonawsKms,
ComAmazonawsDynamodb,
AwsCryptographicMaterialProviders,
TestVectorsAwsCryptographicMaterialProviders,
]
dotnet-version: [ '6.0.x' ]
os: [
windows-latest,
ubuntu-latest,
macos-latest,
]
library:
[
StandardLibrary,
AwsCryptographyPrimitives,
ComAmazonawsKms,
ComAmazonawsDynamodb,
AwsCryptographicMaterialProviders,
TestVectorsAwsCryptographicMaterialProviders,
]
dotnet-version: ["6.0.x"]
os: [windows-latest, ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
permissions:
id-token: write
Expand Down Expand Up @@ -61,7 +58,7 @@ jobs:
with:
dafny-version: ${{ inputs.dafny }}

- name: Download Dependencies
- name: Download Dependencies
working-directory: ./${{ matrix.library }}
run: make setup_net

Expand Down Expand Up @@ -102,4 +99,4 @@ jobs:
dotnet test runtimes/net/tests/LocalCMC.Tests/ \
--framework net6.0
dotnet test runtimes/net/tests/LocalCMC.Tests/ \
--framework net48
--framework net48
2 changes: 1 addition & 1 deletion .github/workflows/manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_dispatch:
inputs:
dafny:
description: 'The Dafny version to use'
description: "The Dafny version to use"
required: true
type: string

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/nightly_dafny.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ jobs:
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
uses: ./.github/workflows/library_dafny_verification.yml
with:
dafny: 'nightly-latest'
dafny: "nightly-latest"
dafny-nightly-verification:
# Don't run the cron builds on forks
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
uses: ./.github/workflows/library_dafny_verification.yml
with:
dafny: 'nightly-latest'
dafny: "nightly-latest"
dafny-nightly-java:
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
uses: ./.github/workflows/library_java_tests.yml
with:
dafny: 'nightly-latest'
dafny: "nightly-latest"
dafny-nightly-net:
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
uses: ./.github/workflows/library_net_tests.yml
with:
dafny: 'nightly-latest'
dafny: "nightly-latest"
4 changes: 2 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Push CI
on:
push:
branches:
- main
- main

jobs:
getVersion:
Expand All @@ -28,4 +28,4 @@ jobs:
needs: getVersion
uses: ./.github/workflows/library_net_tests.yml
with:
dafny: ${{needs.getVersion.outputs.version}}
dafny: ${{needs.getVersion.outputs.version}}
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.2.3 # Use the ref you want to point at
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.2.3 # Use the ref you want to point at
hooks:
- id: trailing-whitespace
- id: trailing-whitespace
Loading

0 comments on commit d6d887c

Please sign in to comment.