A tool to enforce Swift style and conventions, loosely based on the now archived GitHub Swift Style Guide. SwiftLint enforces the style guide rules that are generally accepted by the Swift community. These rules are well described in popular style guides like Ray Wenderlich’s Swift Style Guide. SwiftLint hooks into Clang and SourceKit to use the AST representation of your source files for more accurate results. You might want to move your SwiftLint phase directly before ‘Compile Sources’ step, to detect errors quickly before compiling. However, SwiftLint is designed to run on valid Swift code that cleanly completes the compiler’s parsing stage. So running SwiftLint before ‘Compile Sources’ might yield some incorrect results. SwiftLint hooks into SourceKit so it continues working even as Swift evolves! This also keeps SwiftLint lean, as it doesn’t need to ship with a full Swift compiler, it just communicates with the official one you already have installed on your machine.

Features

  • SwiftLint hooks into Clang and SourceKit
  • Over 100 rules are included in SwiftLint
  • Rules can be disabled with a comment inside a source file
  • Run swiftlint rules to print a list of all available rules and their identifiers
  • Configure SwiftLint by adding a .swiftlint.yml file from the directory you’ll run SwiftLint from
  • You can define custom regex-based rules in your configuration file

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow SwiftLint

SwiftLint Web Site

Other Useful Business Software
Full-stack observability with actually useful AI | Grafana Cloud Icon
Full-stack observability with actually useful AI | Grafana Cloud

Our generous forever free tier includes the full platform, including the AI Assistant, for 3 users with 10k metrics, 50GB logs, and 50GB traces.

Built on open standards like Prometheus and OpenTelemetry, Grafana Cloud includes Kubernetes Monitoring, Application Observability, Incident Response, plus the AI-powered Grafana Assistant. Get started with our generous free tier today.
Create free account
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of SwiftLint!

Additional Project Details

Programming Language

Swift

Related Categories

Swift Library Management Software

Registered

2021-04-07