adamayoung / swiftlint-plugin Goto Github PK
View Code? Open in Web Editor NEWA Swift Package Plugin for SwiftLint
License: Apache License 2.0
A Swift Package Plugin for SwiftLint
License: Apache License 2.0
I have a Swift package executable project that depends on a Swift package library (the library name is swift-duration). The library uses SwiftLintPlugin and it works fine for that library. The problem is with the executable project. The compilation of the executable project finishes with the following error: product 'SwiftLint' required by package 'swift-duration' target 'Duration' not found in package 'SwiftLintPlugin'.
The plugin make the library useless as it breaks compilation. It looks like the plugin can not be used as a linter for a dependency or description how to make it work is missing.
Steps to reproduce:
Create a Swift executable project for instance:
$ mkdir tmp
$ cd tmp
$ swift package init --type executable
In the Package.swift file add the dependency to the swift-duration library. The library depends on the plugin.
let package = Package(
name: "tmp",
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(url: "https://github.com/rojarand/swift-duration", exact: "1.2.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.executableTarget(
name: "tmp",
dependencies: [.product(name: "Duration", package: "swift-duration")]),
.testTarget(
name: "tmpTests",
dependencies: ["tmp"]),
]
)
Try to compile the project from the command line:
$ swift build
or from Xcode IDE.
You will receive the error with the message I mentioned before.
Env details:
swift-driver version: 1.62.15 Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51)
Target: arm64-apple-macosx12.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.