-
Couldn't load subscription status.
- Fork 27
Add compliant and noncompliant examples of python/notebook-best-practice-violation@v1.0 #61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
5a913c3
94a6652
b3890d2
e4b6ee8
f9cd390
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| def __CELL_EDGE__(x): | ||
| pass | ||
|
||
|
|
||
|
|
||
| # {fact rule=notebook-best-practice-violation@v1.0 defects=0} | ||
| # Compliant: cell is not blank. | ||
| __CELL_EDGE__(0) | ||
| x = 12 | ||
| __CELL_EDGE__(1) | ||
| y = 13 | ||
| __CELL_EDGE__(2) | ||
| sum = x + y | ||
| __CELL_EDGE__(3) | ||
| print('End of program') | ||
| # {/fact} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
|
||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| def __CELL_EDGE__(x): | ||
| pass | ||
|
|
||
|
|
||
| # {fact rule=notebook-best-practice-violation@v1.0 defects=1} | ||
| # Noncompliant: cell is blank. | ||
| __CELL_EDGE__(0) | ||
|
|
||
| __CELL_EDGE__(1) | ||
| x = 12 | ||
| __CELL_EDGE__(2) | ||
| y = 13 | ||
| __CELL_EDGE__(3) | ||
| sum = x + y | ||
| __CELL_EDGE__(4) | ||
| print('End of program') | ||
| # {/fact} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This rule detects three kinds of violations: empty cell, too many cel, as well as misplaced imports. You need to add them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Improved examples.