Skip to content
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

Ignore test code in analysis #640

Merged
merged 1 commit into from
Oct 15, 2024
Merged

Conversation

ericwb
Copy link
Contributor

@ericwb ericwb commented Oct 15, 2024

This change, Python specific, determines whether code that is being analyze is unit test or not. By default, the Python parser will not execute rules for test code.

Test code is determined if the scope is within a function that starts with "test_" or withing a "tests" directory or file name that starts with "test_".

Currently the option to skip test code is on the Python parser so that precli's own test code still works. But eventually this should become part of some configuration options for precli.

This change, Python specific, determines whether code that is
being analyze is unit test or not. By default, the Python parser
will not execute rules for test code.

Test code is determined if the scope is within a function that
starts with "test_" or withing a "tests" directory or file
name that starts with "test_".

Currently the option to skip test code is on the Python parser
so that precli's own test code still works. But eventually this
should become part of some configuration options for precli.

Signed-off-by: Eric Brown <[email protected]>
@ericwb ericwb merged commit e2eba9c into securesauce:main Oct 15, 2024
20 checks passed
@ericwb ericwb deleted the ignore_tests branch October 15, 2024 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant