Giter Site home page Giter Site logo

vknabel / vscode-swiftlint Goto Github PK

View Code? Open in Web Editor NEW
20.0 4.0 1.0 404 KB

VS Code extension to enforce Swift style and conventions via SwiftLint

Home Page: https://marketplace.visualstudio.com/items?itemName=vknabel.vscode-swiftlint

License: MIT License

TypeScript 99.93% Swift 0.07%
swift vscode vscode-extension swiftlint linter hacktoberfest

vscode-swiftlint's Introduction

SwiftLint for VS Code

VS Code extension to enforce Swift style and conventions via SwiftLint. You can use SwiftLint installed globally or via the Swift Package Manager.

Global Installation

You can install SwiftLint globally using Homebrew or Mint. For a local setup you can use the Swift Package Manager.

# Using Homebrew
$ brew install swiftlint
# Using Mint
$ mint install realm/SwiftLint
# Manually
$ git clone https://github.com/realm/SwiftLint.git
$ swift build -c release

Local Installation

Add the package to your dependencies in Package.swift:

// swift-tools-version:4.2

import PackageDescription

let package = Package(
    name: "Komondor",
    products: [ ... ],
    dependencies: [
        // My dependencies
        .package(url: "https://github.com/orta/PackageConfig.git", from: "0.0.1"),
        // Dev deps
        .package(url: "https://github.com/orta/Komondor.git", from: "0.0.1"),
+        .package(url: "https://github.com/realm/SwiftLint.git", from: "0.37.0"),
    ],
    targets: [...]
)

Configuration

Config Type Default Description
swiftlint.enable Bool true Whether SwiftLint should actually do something.
swiftlint.onlyEnableOnSwiftPMProjects Bool false Requires and uses a SwiftLint as SwiftPM dependency.
swiftlint.onlyEnableWithConfig Bool false Only lint if config present.
swiftlint.path String swiftlint The location of the globally installed SwiftLint (resolved with the current path if only a filename).
swiftlint.additionalParameters [String] [] Additional parameters to pass to SwiftLint.
swiftlint.configSearchPaths [String] [] Possible paths for SwiftLint config. This disables nested configurations!
swiftlint.autoLintWorkspace Bool true Automatically lint the whole project right after start.

Commands

Short Title Command
SwiftLint: Lint workspace swiftlint.lintWorkspace
SwiftLint: Fix workspace swiftlint.fixWorkspace
SwiftLint: Fix document swiftlint.fixDocument

To automatically fix all issues within a document on save, add the following to your .vscode/settings.json:

{
  "editor.codeActionsOnSave": {
    "source.fixAll": true
  }
}

Contributors

License

vscode-swiftlint is available under the MIT license.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.