bealex / SwiftLintAppCode

Provides highlighting of the SwiftLint errors in the AppCode
MIT License
52 stars 8 forks source link

SwiftLint for AppCode

This plugin shows errors and warnings from SwiftLint in JetBrains AppCode.

Screenshot:

Screenshot of the plugin showing a warning on a Swift file in AppCode

Install

  1. Install swiftlint binary from https://github.com/realm/SwiftLint
  2. Install plugin
    • Open AppCode Preferences and go to Plugins.
    • Click the Marketplace tab
    • Enter "SwiftLint" in the search box
    • Click Install
    • Click OK
  3. Restart AppCode
  4. Set swiftlint binary path (per project setting, should be OK by default but who knows)
    • Open AppCode Preferences and go to Tools > SwiftLint.
    • Update the "SwiftLint binary path" box
    • Screenshot SwiftLint settings in AppCode Preferences
  5. Enable inspection (per project setting)
    • Open AppCode Preferences and go to Editor > Inspections.
    • Check the box next to Swift > "SwiftLint (available for Code|Inspect Code)"
    • Screenshot Section Inspections of AppCode Preferences

Use

Lint errors appear in your code as red underlines, orange highlighting. This depends on severity.

How to configure the lint rules:

  1. Create a file called .swiftlint.yml in the root directory of your project.
  2. Add rules configuration there. Consult the docs: https://github.com/realm/SwiftLint#rules

How to disable rules in code: https://github.com/realm/SwiftLint#disable-rules-in-code. There is an autocompletion for that. Just try autocompletion inside the comment.

Develop the Plugin

This is a DevKit plugin. And it is old, so be prepared.

You will need: