File tree 4 files changed +40
-36
lines changed
Sources/SourceKitLSPDevUtils 4 files changed +40
-36
lines changed Original file line number Diff line number Diff line change @@ -6,23 +6,26 @@ let package = Package(
6
6
name: " SourceKitLSPDevUtils " ,
7
7
platforms: [ . macOS( . v10_15) ] ,
8
8
products: [
9
- . executable( name: " sourcekit-lsp-dev-utils " , targets: [ " SourceKitLSPDevUtils " ] ) ,
9
+ . executable( name: " sourcekit-lsp-dev-utils " , targets: [ " SourceKitLSPDevUtils " ] )
10
10
] ,
11
11
dependencies: [
12
12
. package ( url: " https://github.com/swiftlang/swift-syntax.git " , from: " 600.0.1 " ) ,
13
13
. package ( url: " https://github.com/apple/swift-argument-parser.git " , from: " 1.5.0 " ) ,
14
14
] ,
15
15
targets: [
16
- . executableTarget( name: " SourceKitLSPDevUtils " , dependencies: [
17
- " ConfigSchemaGen " ,
18
- . product( name: " ArgumentParser " , package : " swift-argument-parser " ) ,
19
- ] ) ,
16
+ . executableTarget(
17
+ name: " SourceKitLSPDevUtils " ,
18
+ dependencies: [
19
+ " ConfigSchemaGen " ,
20
+ . product( name: " ArgumentParser " , package : " swift-argument-parser " ) ,
21
+ ]
22
+ ) ,
20
23
. target(
21
24
name: " ConfigSchemaGen " ,
22
25
dependencies: [
23
26
. product( name: " SwiftSyntax " , package : " swift-syntax " ) ,
24
27
. product( name: " SwiftParser " , package : " swift-syntax " ) ,
25
28
]
26
- )
29
+ ) ,
27
30
]
28
31
)
Original file line number Diff line number Diff line change @@ -14,11 +14,11 @@ import ArgumentParser
14
14
import ConfigSchemaGen
15
15
16
16
struct GenerateConfigSchema : ParsableCommand {
17
- static let configuration = CommandConfiguration (
18
- abstract: " Generate a JSON schema and documentation for the SourceKit-LSP configuration file "
19
- )
17
+ static let configuration = CommandConfiguration (
18
+ abstract: " Generate a JSON schema and documentation for the SourceKit-LSP configuration file "
19
+ )
20
20
21
- func run( ) throws {
22
- try ConfigSchemaGen . generate ( )
23
- }
21
+ func run( ) throws {
22
+ try ConfigSchemaGen . generate ( )
23
+ }
24
24
}
Original file line number Diff line number Diff line change @@ -15,22 +15,23 @@ import ConfigSchemaGen
15
15
import Foundation
16
16
17
17
struct VerifyConfigSchema : ParsableCommand {
18
- static let configuration = CommandConfiguration (
19
- abstract: " Verify that the generated JSON schema and documentation for the SourceKit-LSP configuration file are up-to-date "
20
- )
18
+ static let configuration = CommandConfiguration (
19
+ abstract:
20
+ " Verify that the generated JSON schema and documentation for the SourceKit-LSP configuration file are up-to-date "
21
+ )
21
22
22
- func run( ) throws {
23
- let plans = try ConfigSchemaGen . plan ( )
24
- for plan in plans {
25
- print ( " Verifying \( plan. category) at \" \( plan. path. path) \" " )
26
- let expectedContents = try plan. contents ( )
27
- let actualContents = try Data ( contentsOf: plan. path)
28
- guard expectedContents == actualContents else {
29
- print ( " FATAL: \( plan. category) is out-of-date! " )
30
- print ( " Please run `./sourcekit-lsp-dev-utils generate-config-schema` to update it. " )
31
- throw ExitCode . failure
32
- }
33
- }
34
- print ( " All schemas are up-to-date! " )
23
+ func run( ) throws {
24
+ let plans = try ConfigSchemaGen . plan ( )
25
+ for plan in plans {
26
+ print ( " Verifying \( plan. category) at \" \( plan. path. path) \" " )
27
+ let expectedContents = try plan. contents ( )
28
+ let actualContents = try Data ( contentsOf: plan. path)
29
+ guard expectedContents == actualContents else {
30
+ print ( " FATAL: \( plan. category) is out-of-date! " )
31
+ print ( " Please run `./sourcekit-lsp-dev-utils generate-config-schema` to update it. " )
32
+ throw ExitCode . failure
33
+ }
35
34
}
35
+ print ( " All schemas are up-to-date! " )
36
+ }
36
37
}
Original file line number Diff line number Diff line change @@ -14,12 +14,12 @@ import ArgumentParser
14
14
15
15
@main
16
16
struct SourceKitLSPDevUtils : ParsableCommand {
17
- static let configuration = CommandConfiguration (
18
- commandName: " sourcekit-lsp-dev-utils " ,
19
- abstract: " Utilities for developing SourceKit-LSP " ,
20
- subcommands: [
21
- GenerateConfigSchema . self,
22
- VerifyConfigSchema . self,
23
- ]
24
- )
17
+ static let configuration = CommandConfiguration (
18
+ commandName: " sourcekit-lsp-dev-utils " ,
19
+ abstract: " Utilities for developing SourceKit-LSP " ,
20
+ subcommands: [
21
+ GenerateConfigSchema . self,
22
+ VerifyConfigSchema . self,
23
+ ]
24
+ )
25
25
}
You can’t perform that action at this time.
0 commit comments