Skip to main content

Lint code and project

Project linting#

One of the benefits of making the definition of projects explicit, is that we can run checks on them and uncover configuration issues that otherwise would be bubbled up by the build system later on. Tuist follows the principle of the sooner we detect the errors, the less time developers will have to spend. For that reason, we provide a command that developers can run either locally or on CI to ensure their projects have a valid configuration:

tuist lint project
note

Please note that there are checks that only the compiler and the build system can do. In other words, those will only be uncovered by compiling the app with Xcode or xcodebuild.

Code linting#

Tuist provides a command for linting the Swift code of your projects by leveraging SwiftLint. All you need to do is run the following command:

tuist lint code # All the targetstuist lint code MyTarget

You can provide your SwiftLint configuration file by placing it under the root /Tuist directory.

Arguments#

ArgumentShortDescriptionDefaultRequired
--path-pThe path to the directory that contains the workspace or project whose code will be linted.No
--strict-sFails on warnings.No