Skip to content

Commit 4a9d617

Browse files
authored
chore: Remove Dafny warnings (#1742)
Remove all Dafny warnings and set warnings to error. By removing all the errors, --allow-warnings can be removed from verification. This means that any verification warning will now fail the build. This is especially relevant if {:only} is ever committed. See aws/aws-cryptographic-material-providers-library#517. This would now cause CI verification to fail.
1 parent 428a013 commit 4a9d617

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/src/DdbMiddlewareConfig.dfy

+5-3
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@ module DdbMiddlewareConfig {
4747
function SearchModifies(config: Config) : set<object>
4848
{
4949
//set x, y | y in config.tableEncryptionConfigs && x in OneSearchModifies(config.tableEncryptionConfigs[y]) :: x
50-
set versions <- set configValue <- config.tableEncryptionConfigs.Values | configValue.search.Some? :: configValue.search.value.versions,
51-
keyStore <- set version <- versions :: version.keySource.store,
52-
obj <- keyStore.Modifies | obj in keyStore.Modifies :: obj
50+
set
51+
versions <- (set configValue <- config.tableEncryptionConfigs.Values | configValue.search.Some? :: configValue.search.value.versions),
52+
keyStore <- (set version <- versions :: version.keySource.store),
53+
obj <- keyStore.Modifies
54+
{:nowarn} :: obj
5355

5456
}
5557

DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/src/Index.dfy

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ module
132132
+ (if tableConfig.legacyOverride.Some? then tableConfig.legacyOverride.value.encryptor.Modifies else {})
133133
+ (if tableConfig.search.Some? then tableConfig.search.value.versions[0].keyStore.Modifies else {})
134134
)
135-
:: o;
135+
{:nowarn} :: o; // ignore warning for missing trigger on quantifier
136136

137137
var allLogicalTableNames := {};
138138
var i := 0;

SharedMakefile.mk

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ include $(SMITHY_DAFNY_ROOT)/SmithyDafnyMakefile.mk
1313

1414
VERIFY_TIMEOUT := 250
1515

16-
verify:DAFNY_OPTIONS=--allow-warnings --allow-external-contracts --log-format csv
17-
verify_single:DAFNY_OPTIONS=--allow-warnings --allow-external-contracts --log-format csv
18-
verify_service:DAFNY_OPTIONS=--allow-warnings --allow-external-contracts --log-format csv
16+
verify:DAFNY_OPTIONS=--allow-deprecation --allow-external-contracts --log-format csv
17+
verify_single:DAFNY_OPTIONS=--allow-deprecation --allow-external-contracts --log-format csv
18+
verify_service:DAFNY_OPTIONS=--allow-deprecation --allow-external-contracts --log-format csv
1919

2020
transpile_implementation_net: DAFNY_OPTIONS=--allow-warnings --compile-suffix --legacy-module-names --allow-external-contracts
2121
transpile_test_net: DAFNY_OPTIONS=--allow-warnings --include-test-runner --compile-suffix --legacy-module-names --allow-external-contracts

0 commit comments

Comments
 (0)