Skip to content

Commit 0150cee

Browse files
ahoppenmeg-gupta
authored andcommitted
[Build] Enable RawSyntaxValidation for SwiftSyntax PR job
1 parent 8c83fa2 commit 0150cee

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

utils/build-presets.ini

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1853,6 +1853,7 @@ mixin-preset=mixin_swiftpm_package_macos_platform
18531853
release
18541854
assertions
18551855
swiftsyntax
1856+
swiftsyntax-enable-rawsyntax-validation
18561857
swiftsyntax-verify-generated-files
18571858
swiftsyntax-lint
18581859
swiftformat
@@ -1866,9 +1867,10 @@ mixin-preset=mixin_swiftpm_package_linux_platform
18661867
release
18671868
assertions
18681869
swiftsyntax
1869-
sourcekit-lsp
1870+
swiftsyntax-enable-rawsyntax-validation
18701871
swiftsyntax-verify-generated-files
18711872
swiftsyntax-lint
1873+
sourcekit-lsp
18721874
swiftformat
18731875

18741876
#===------------------------------------------------------------------------===#

utils/build_swift/build_swift/driver_arguments.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,8 +716,13 @@ def create_argument_parser():
716716
help='install SwiftSyntax')
717717
option('--swiftsyntax-verify-generated-files',
718718
toggle_true('swiftsyntax_verify_generated_files'),
719-
help='set to verify that the generated files in the source tree '
719+
help='set to verify that the generated files in the source tree ' +
720720
'match the ones that would be generated from current main')
721+
option('--swiftsyntax-enable-rawsyntax-validation',
722+
toggle_true('swiftsyntax_enable_rawsyntax_validation'),
723+
help='set to validate that RawSyntax layout nodes contain children of ' +
724+
'the expected types and that RawSyntax tokens have the expected ' +
725+
'token kinds')
721726
option('--swiftsyntax-lint',
722727
toggle_true('swiftsyntax_lint'),
723728
help='verify that swift-syntax Source code is formatted correctly')

utils/build_swift/tests/expected_options.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
'install_swift_driver': False,
112112
'install_swiftdocc': False,
113113
'swiftsyntax_verify_generated_files': False,
114+
'swiftsyntax_enable_rawsyntax_validation': False,
114115
'swiftsyntax_lint': False,
115116
'install_playgroundsupport': False,
116117
'install_sourcekitlsp': False,
@@ -606,6 +607,8 @@ class BuildScriptImplOption(_BaseOption):
606607
EnableOption('--install-swiftsyntax', dest='install_swiftsyntax'),
607608
EnableOption('--swiftsyntax-verify-generated-files',
608609
dest='swiftsyntax_verify_generated_files'),
610+
EnableOption('--swiftsyntax-enable-rawsyntax-validation',
611+
dest='swiftsyntax_enable_rawsyntax_validation'),
609612
EnableOption('--swiftsyntax-lint',
610613
dest='swiftsyntax_lint'),
611614
EnableOption('--install-swiftpm', dest='install_swiftpm'),

utils/swift_build_support/swift_build_support/products/swiftsyntax.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ def run_swiftsyntax_build_script(self, target, command, additional_params=[]):
6363
if self.is_release():
6464
build_cmd.append('--release')
6565

66+
if self.args.swiftsyntax_enable_rawsyntax_validation:
67+
build_cmd.append('--enable-rawsyntax-validation')
68+
6669
if self.args.verbose_build:
6770
build_cmd.append('--verbose')
6871

0 commit comments

Comments
 (0)