-
Notifications
You must be signed in to change notification settings - Fork 28
Add compliant and noncompliant examples of python/[email protected] #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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the CELL_EDGE markers |
||
|
||
|
||
# {fact [email protected] 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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need separate files for compliant and non compliant? Can these be in the same There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. to cover all three types of violation(blank cell, cell limit, misplaced imports) in one file is not possible. Is it ok if we create separate files for each example? |
||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
def __CELL_EDGE__(x): | ||
pass | ||
|
||
|
||
# {fact [email protected] 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.