[tool] idefiles remove analysis_options.yaml generation

This caused issues when running analyzer tests locally.

Bug: https://github.com/dart-lang/sdk/issues/35562

Instead, SDK devs should use DartCode's option to ignore files in
VSCode:
https://github.com/dart-lang/sdk/issues/35562#issuecomment-543140783

For other IDEs there is no documented solution.

Change-Id: Ibf3f47d1035ea5d98c1db8fd1209677453588327
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207021
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
This commit is contained in:
Daco Harkes
2021-07-15 10:53:29 +00:00
committed by commit-bot@chromium.org
parent f8f0de4f12
commit 31bdde436f
-59
View File
@@ -23,7 +23,6 @@ HOST_OS = utils.GuessOS()
def GenerateIdeFiles(options):
GenerateCompileCommands(options)
GenerateAnalysisOptions(options)
def GenerateCompileCommands(options):
@@ -81,64 +80,6 @@ def GenerateCompileCommands(options):
return 0
def GenerateAnalysisOptions(options):
"""Generate analysis_optioms.yaml for the Dart analyzer.
To prevent dartanalyzer from tripping on the non-Dart files when it is
started from the root dart-sdk directory.
https://github.com/dart-lang/sdk/issues/35562
Args:
options: supported options include: force, dir
"""
contents = """analyzer:
exclude:
- benchmarks/**
- benchmarks-internal/**
- docs/newsletter/20171103/**
- pkg/**
- out/**
- runtime/**
- samples-dev/swarm/**
- sdk/lib/**
- tests/co19/**
- tests/co19_2/**
- tests/corelib/**
- tests/corelib_2/**
- tests/web/**
- tests/web_2/**
- tests/dartdevc/**
- tests/dartdevc_2/**
- tests/ffi/**
- tests/ffi_2/**
- tests/language/**
- tests/language_2/**
- tests/lib/**
- tests/lib_2/**
- tests/modular/**
- tests/standalone/**
- tests/standalone_2/**
- third_party/observatory_pub_packages/**
- third_party/pkg/**
- third_party/pkg_tested/dart_style/**
- third_party/tcmalloc/**
- tools/apps/update_homebrew/**
- tools/dart2js/**
- tools/dom/**
- tools/sdks/dart-sdk/lib/**
- tools/status_clean.dart
- xcodebuild/**"""
fname = os.path.join(options.dir, "analysis_options.yaml")
if os.path.isfile(fname) and not options.force:
print(fname + " already exists, use --force to override")
return
with open(fname, "w") as f:
f.write(contents)
def main(argv):
parser = argparse.ArgumentParser(
description="Python script to generate compile_commands.json and "