Skip to content

Commit

Permalink
Python: add messaging about deprecated options
Browse files Browse the repository at this point in the history
  • Loading branch information
yoff committed Sep 23, 2024
1 parent 3a53787 commit e0cec32
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions python/extractor/semmle/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ def make_parser():
config_options.add_option("--colorize", dest="colorize", default=False, action="store_true",
help = """Colorize the logging output.""")

config_options.add_option("--dont-extract-stdlib", dest="extract_stdlib", action="store_false",
help="This flag is deprecated; not extracting the standard library is now the default.")
config_options.add_option("--extract-stdlib", dest="extract_stdlib", default=False, action="store_true",
help="Extract the standard library.")

Expand Down Expand Up @@ -224,10 +226,18 @@ def parse(command_line):
max_import_depth = float('inf')
options.max_import_depth = max_import_depth

if 'CODEQL_EXTRACTOR_PYTHON_DONT_EXTRACT_STDLIB' in os.environ:
options.extract_stdlib = False
print ("Warning: CODEQL_EXTRACTOR_PYTHON_DONT_EXTRACT_STDLIB is deprecated; the default is now to not extract the standard library.")

if 'CODEQL_EXTRACTOR_PYTHON_EXTRACT_STDLIB' in os.environ:
options.extract_stdlib = True

options.prune = True

if option.extract_stdlib:
print ("Warning: The analysis will extract the standard library. This behavior is deprecated and will be removed in a future release. We expect it to be gone in CLI version 2.20.0.")

return options, args

def split_and_flatten(options_list, div):
Expand Down

0 comments on commit e0cec32

Please sign in to comment.