Skip to content

[build-script] Remove option to lint swift-syntax #79834

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
Mar 7, 2025
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
3 changes: 0 additions & 3 deletions utils/build-presets.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2001,7 +2001,6 @@ swiftsyntax
swiftsyntax-enable-rawsyntax-validation
swiftsyntax-enable-test-fuzzing
swiftsyntax-verify-generated-files
swiftsyntax-lint
swiftformat
skstresstester
sourcekit-lsp
Expand Down Expand Up @@ -2030,7 +2029,6 @@ assertions
swiftsyntax
swiftformat
install-swiftformat
swiftsyntax-lint
sourcekit-lsp-lint

[preset: buildbot_swiftformat_linux]
Expand All @@ -2039,7 +2037,6 @@ release
assertions
swiftsyntax
swiftformat
swiftsyntax-lint

#===------------------------------------------------------------------------===#
# Test Swift Stress Tester
Expand Down
3 changes: 0 additions & 3 deletions utils/build_swift/build_swift/driver_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -788,9 +788,6 @@ def create_argument_parser():
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')
option(['--install-sourcekit-lsp'], toggle_true('install_sourcekitlsp'),
help='install SourceKitLSP')
option(['--install-swiftformat'], toggle_true('install_swiftformat'),
Expand Down
3 changes: 0 additions & 3 deletions utils/build_swift/tests/expected_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@
'swiftsyntax_verify_generated_files': False,
'swiftsyntax_enable_rawsyntax_validation': False,
'swiftsyntax_enable_test_fuzzing': False,
'swiftsyntax_lint': False,
'install_playgroundsupport': False,
'install_sourcekitlsp': False,
'install_swiftformat': False,
Expand Down Expand Up @@ -667,8 +666,6 @@ class BuildScriptImplOption(_BaseOption):
dest='swiftsyntax_enable_rawsyntax_validation'),
EnableOption('--swiftsyntax-enable-test-fuzzing',
dest='swiftsyntax_enable_test_fuzzing'),
EnableOption('--swiftsyntax-lint',
dest='swiftsyntax_lint'),
EnableOption('--install-swiftpm', dest='install_swiftpm'),
EnableOption('--install-swift-driver', dest='install_swift_driver'),
EnableOption('--install-sourcekit-lsp', dest='install_sourcekitlsp'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,39 +103,9 @@ def should_build(self, host_target):

def build(self, host_target):
self.run_build_script_helper('build', host_target)
if self.args.swiftsyntax_lint:
self.lint_swiftsyntax(host_target)
if self.args.sourcekitlsp_lint:
self.lint_sourcekitlsp()

def lint_swiftsyntax(self, host_target):
swift_exec = os.path.join(
self.install_toolchain_path(host_target),
'bin',
'swift'
)
swift_syntax_dev_utils_dir = os.path.join(
os.path.dirname(self.source_dir),
'swift-syntax',
'SwiftSyntaxDevUtils'
)
swift_format_exec = os.path.join(
self.build_dir,
self.configuration(),
'swift-format'
)
linting_cmd = [
swift_exec,
'run',
'--package-path', swift_syntax_dev_utils_dir,
'swift-syntax-dev-utils',
'format',
'--verbose',
'--lint',
'--swift-format', swift_format_exec
]
shell.call(linting_cmd, env={'SWIFTCI_USE_LOCAL_DEPS': '1'})

def lint_sourcekitlsp(self):
linting_cmd = [
os.path.join(self.build_dir, self.configuration(), 'swift-format'),
Expand Down