Try using SwiftLint

Overview

realm/SwiftLint: A tool to enforce Swift style and conventions.

What you can see in this article

Installation

Homebrew

brew install swiftlint

Package Manager for macOS (or Linux) — Homebrew

Used with Xcode

Add the following to Run Phases as shown on the Official Page.

if which swiftlint >/dev/null; then
  swiftlint
else
  echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
fi

A lot of warnings are coming out!

スクリーンショット 2020-10-04 12.58.41.png

How to deal with the crazy Whitespace Violation

By inserting swiftlint There are now a lot of trailing_whitespace warnings.

It seems to happen when there is a space in a blank line, but it is troublesome to erase the space when each line is open.

Check Preference> TextEditing> Editing> ʻIncluding whitespace-only lines` to eliminate this.

If you apply this, the blank space will be erased without permission.

Conducted Swift Lint with Github Actions

norio-nomura/action-swiftlint: GitHub Action for SwiftLint I used this.

Summary

There are many other ways to do it realm / SwiftLint: A tool to enforce Swift style and conventions. Please check.

reference

Recommended Posts

Try using SwiftLint
Try using Maven
Try using powermock-mockito2-2.0.2
Try using GraalVM
Try using jmockit 1.48
Try using sql-migrate
Try using Log4j 2.0
Try using Axon Framework
Try using JobScheduler's REST-API
Try using java.lang.Math methods
Try using PowerMock's WhiteBox
Try using Talend Part 1
Try using F # list
Try using each_with_index method
Try using Spring JDBC
Try using RocksDB in Java
Try using GloVe with Deeplearning4j
Try using view_component with rails
Try scraping using java [Notes]
Try using Cocoa from Ruby
Try using letter_opener_web for inquiries
[Swift] Try using Collection View
Try using IntelliJ IDEA once
Try using Spring Boot Security
Try using gRPC in Ruby
[Rails] Try using Faraday middleware
[Processing] Try using GT Force.
[Programming Encyclopedia] §2 Try using Ruby
People using docker Try using docker-compose
Try using Redmine on Mac docker
Try using Redis with Java (jar)
[Java] Try to implement using generics
Try using the messaging system Pulsar
Try using IBM Java method tracing
Try using Hyperledger Iroha's Java SDK
[Java] Where did you try using java?
Try using Java framework Nablarch [Web application]
Try using || instead of the ternary operator
Try HiveRunner
Try using the service on Android Oreo
Try using the Rails API (zip code)
Try Mockito
Study Java Try using Scanner or Map
Try Selenium
Try DbUnit
Try using Spring Boot with VS Code
Try using Reladomo's MT Loader (Multi-Threaded Matcher Loader)
try docker-compose
Try using JobScheduler's REST-API --Java RestClient implementation--
Try using Kong + Konga with Docker Compose.
Try using the Emotion API from Android
Try using the Wii remote with Java
Try Lombok
Try using simple_form / edit even child models
Try implementing GraphQL server using grahpql-java-tools (+ kotlin)
Try using Firebase Cloud Functions on Android (Java)
Try using conditional branching other than if statement
Beginners try using android studio Part 2 (event processing)
Try local file search using Fess on CentOS7
Try local file search using Fess on CentOS8
Try using Sourcetrail (win version) in Java code