Skip to content

[Build] Enable RawSyntaxValidation for SwiftSyntax PR job #64748

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

Merged
merged 1 commit into from
Apr 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 3 additions & 1 deletion utils/build-presets.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1853,6 +1853,7 @@ mixin-preset=mixin_swiftpm_package_macos_platform
release
assertions
swiftsyntax
swiftsyntax-enable-rawsyntax-validation
swiftsyntax-verify-generated-files
swiftsyntax-lint
swiftformat
Expand All @@ -1866,9 +1867,10 @@ mixin-preset=mixin_swiftpm_package_linux_platform
release
assertions
swiftsyntax
sourcekit-lsp
swiftsyntax-enable-rawsyntax-validation
swiftsyntax-verify-generated-files
swiftsyntax-lint
sourcekit-lsp
swiftformat

#===------------------------------------------------------------------------===#
Expand Down
7 changes: 6 additions & 1 deletion utils/build_swift/build_swift/driver_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -716,8 +716,13 @@ def create_argument_parser():
help='install SwiftSyntax')
option('--swiftsyntax-verify-generated-files',
toggle_true('swiftsyntax_verify_generated_files'),
help='set to verify that the generated files in the source tree '
help='set to verify that the generated files in the source tree ' +
'match the ones that would be generated from current main')
option('--swiftsyntax-enable-rawsyntax-validation',
toggle_true('swiftsyntax_enable_rawsyntax_validation'),
help='set to validate that RawSyntax layout nodes contain children of ' +
'the expected types and that RawSyntax tokens have the expected ' +
'token kinds')
option('--swiftsyntax-lint',
toggle_true('swiftsyntax_lint'),
help='verify that swift-syntax Source code is formatted correctly')
Expand Down
3 changes: 3 additions & 0 deletions utils/build_swift/tests/expected_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
'install_swift_driver': False,
'install_swiftdocc': False,
'swiftsyntax_verify_generated_files': False,
'swiftsyntax_enable_rawsyntax_validation': False,
'swiftsyntax_lint': False,
'install_playgroundsupport': False,
'install_sourcekitlsp': False,
Expand Down Expand Up @@ -606,6 +607,8 @@ class BuildScriptImplOption(_BaseOption):
EnableOption('--install-swiftsyntax', dest='install_swiftsyntax'),
EnableOption('--swiftsyntax-verify-generated-files',
dest='swiftsyntax_verify_generated_files'),
EnableOption('--swiftsyntax-enable-rawsyntax-validation',
dest='swiftsyntax_enable_rawsyntax_validation'),
EnableOption('--swiftsyntax-lint',
dest='swiftsyntax_lint'),
EnableOption('--install-swiftpm', dest='install_swiftpm'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ def run_swiftsyntax_build_script(self, target, command, additional_params=[]):
if self.is_release():
build_cmd.append('--release')

if self.args.swiftsyntax_enable_rawsyntax_validation:
build_cmd.append('--enable-rawsyntax-validation')

if self.args.verbose_build:
build_cmd.append('--verbose')

Expand Down