Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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,18 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Improved examples.

# SPDX-License-Identifier: Apache-2.0

def __CELL_EDGE__(x):
pass
Copy link
Contributor

Choose a reason for hiding this comment

The 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.
Copy link
Contributor

Choose a reason for hiding this comment

The 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 .py file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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}