Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

# {fact rule=notebook-invalid-execution-order@v1.0 defects=1}
# Noncompliant: execution order of cells is not linear. When executing
# cells in linear order, variables `x` and `y` are undefined before use.
# —— Code Cell 1, Execution Count 2 —— #
sum = x + y
product = x * y
exp = x ** y
# —— Code Cell 2, Execution Count 1 —— #
x = 12
y = 13
# —— Code Cell 3, Execution Count 3 —— #
print(sum, product, exp)
# {/fact}


# {fact rule=notebook-invalid-execution-order@v1.0 defects=0}
# Compliant: execution order of cells is linear.
# —— Code Cell 1, Execution Count 1 —— #
x = 12
y = 13
# —— Code Cell 2, Execution Count 2 —— #
sum = x + y
product = x * y
exp = x ** y
# —— Code Cell 3, Execution Count 3 —— #
print(sum, product, exp)
# {/fact}