Skip to content

Commit 2fce7bf

Browse files
committed
[Build] Enable RawSyntaxValidation for SwiftSyntax PR job
1 parent e219699 commit 2fce7bf

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
@@ -1855,6 +1855,7 @@ mixin-preset=mixin_swiftpm_package_macos_platform
18551855
release
18561856
assertions
18571857
swiftsyntax
1858+
swiftsyntax-enable-rawsyntax-validation
18581859
swiftsyntax-verify-generated-files
18591860
swiftsyntax-lint
18601861
swiftformat
@@ -1868,9 +1869,10 @@ mixin-preset=mixin_swiftpm_package_linux_platform
18681869
release
18691870
assertions
18701871
swiftsyntax
1871-
sourcekit-lsp
1872+
swiftsyntax-enable-rawsyntax-validation
18721873
swiftsyntax-verify-generated-files
18731874
swiftsyntax-lint
1875+
sourcekit-lsp
18741876
swiftformat
18751877

18761878
#===------------------------------------------------------------------------===#

utils/build_swift/build_swift/driver_arguments.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,8 +714,13 @@ def create_argument_parser():
714714
help='install SwiftSyntax')
715715
option('--swiftsyntax-verify-generated-files',
716716
toggle_true('swiftsyntax_verify_generated_files'),
717-
help='set to verify that the generated files in the source tree '
717+
help='set to verify that the generated files in the source tree ' +
718718
'match the ones that would be generated from current main')
719+
option('--swiftsyntax-enable-rawsyntax-validation',
720+
toggle_true('swiftsyntax_enable_rawsyntax_validation'),
721+
help='set to validate that RawSyntax layout nodes contain children of ' +
722+
'the expected types and that RawSyntax tokens have the expected ' +
723+
'token kinds')
719724
option('--swiftsyntax-lint',
720725
toggle_true('swiftsyntax_lint'),
721726
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,
@@ -605,6 +606,8 @@ class BuildScriptImplOption(_BaseOption):
605606
EnableOption('--install-swiftsyntax', dest='install_swiftsyntax'),
606607
EnableOption('--swiftsyntax-verify-generated-files',
607608
dest='swiftsyntax_verify_generated_files'),
609+
EnableOption('--swiftsyntax-enable-rawsyntax-validation',
610+
dest='swiftsyntax_enable_rawsyntax_validation'),
608611
EnableOption('--swiftsyntax-lint',
609612
dest='swiftsyntax_lint'),
610613
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)