In this section:
Parasoft supports Swift by integrating with SwiftLint, an open source static analysis tool for Swift source code. SwiftLint reports issues related to Swift programming style and conventions. Refer to the SwiftLint documentation for a more detailed description: https://github.com/realm/SwiftLint
The Parasoft SwiftLint extension processes the result file output from your open source static analysis tool, generates reports showing violations and severities for the code authors, and sends the data to Parasoft DTP. DTP presents the data in widgets, reports, and other interfaces that enable you to prioritize violations, place them into remediation workflows, and monitor progress toward improving the code quality.
reporter: "checkstyle"
>> swiftlint > report.xml
Some rules in SwiftLint have two possible severities. Depending on the case, the violation may either have an "error" or "warning" severity. For such rules, these violations will have one specific "error" severity after processing with Parasoft SwiftLint extension.
multilanguage-pack.sh -tool SwiftLint -results.file "c:\sample\swiftlint-results.xml" -source.dir "C:\sample\sampleProjectFolder" |
Internal technical log files from the Multi-Language Pack execution are generated in the <INSTALL>/.mlp subdirectory.
The following parameters are required.
This parameter specifies the Parasoft extension to execute. Use -tool SwiftLint
to run the SwiftLint extension.
Path to the SwiftLint analysis results file.
Specifies the path to the folder containing the original Swift code that has been analyzed by SwiftLint. This is used to collect source control metadata (e.g., authorship, last updated, etc.) for DTP reporting and processing.
This simple example is designed to help you quickly run the SwiftLint Parasoft Extension. It uses a very simple sample of Swift source code and SwiftLint results. You can follow this example if you do not yet have Swift and SwiftLint.
Refer to the following script:
example\swiftlint\swiftlint-analyzer.sh.
The script runs multilanguage-pack.sh with the following settings:
-tool SwiftLint
-results.file example/swiftlint/checkstyle.xml
-source.dir example/swiftlint/src
Before running the script, set the DTP properties in the settings file as described in the Configuration chapter.
Run the script example\swiftlint\swiftlint-analyzer.sh.
After execution, a Parasoft report.xml file and a report.html file will be generated. The results will also be sent to DTP.