Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install SwiftLint under Ubuntu16.04

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "how to install SwiftLint under Ubuntu16.04". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to install SwiftLint under Ubuntu16.04.

SwiftLint conducts code review based on the Swift code specification published by Github and integrates well with Xcode. After configuring all the settings, when compiling in Xcode, SwiftLint will automatically run the check, and the code that does not conform to the specification will be indicated in the form of warning or error, and has a wealth of configuration items, which can be customized a lot, which is quite convenient.

Swiftlint installation environment:

System: Ubuntu 16.04Swfit: swift-5.0.2-RELEASE-ubuntu16.04

Command line installation

Use the following command:

Git clone https://github.com/realm/SwiftLint.gitcd SwiftLintswift build-c release-- static-swift-stdlib

Path after installation is complete

Configure PATH environment variable export PATH=/ absolute path / SwiftLint/.build/x86_64-unknown-linux/release/: "${PATH}" configure SourceKit

The SwiftLint check code format is based on Swift's SourceKit, and the file is located in usr/lib/libsourcekitdInProc.so, which needs to be copied to the realse path:

Cp / absolute path / swift-5.0.2-RELEASE-ubuntu16.04/usr/lib/libsourcekitdInProc.so / absolute path / SwiftLint/.build/x86_64-unknown-linux/release/ Verification

Verify this with the swiftlint version command:

Remember to add Path to the ~ / .bash_profile file after verification.

Problems that may be encountered

If you may encounter a compilation failure after installation, you can try to install the following command:

Apt-get install-y clang libblocksruntime0 libcurl4-openssl-dev

For other possible questions, please refer to Swiftlint's Github about Linux's issues https://github.com/realm/SwiftLint/issues/732.

Linux environment variable PATH description

There are three ways to modify the Linux environment variable PATH, which you can choose according to the situation.

1. Export PATH=/ absolute path /: "${PATH}" (recommended)

Using this method, it is only valid for the current session, that is, every time you log out or log out of the system, the PATH setting becomes invalid.

2. Vi ~ / .bash_profile (recommended)

Using this method, it is only valid for the current user, and after switching login users, the PATH setting will become invalid.

3 、 vi / etc/profile

Using this method, it is effective for all users and may cause security problems to the system.

At this point, I believe you have a deeper understanding of "how to install SwiftLint under Ubuntu16.04". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report