https://github.com/ivan-magda/ifmo-swift-static-analyzer
A command line tool to enforce Swift style and conventions.
https://github.com/ivan-magda/ifmo-swift-static-analyzer
ifmo static-analyzer swift
Last synced: 8 months ago
JSON representation
A command line tool to enforce Swift style and conventions.
- Host: GitHub
- URL: https://github.com/ivan-magda/ifmo-swift-static-analyzer
- Owner: ivan-magda
- License: mit
- Created: 2018-06-07T08:31:38.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-08T21:39:16.000Z (about 8 years ago)
- Last Synced: 2024-12-26T04:42:49.682Z (over 1 year ago)
- Topics: ifmo, static-analyzer, swift
- Language: Swift
- Size: 34.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Swift Static Analyzer
`IFMO course project`
***SwiftLinter*** is a tool, that helps to enforce Swift style and conventions, based on [GitHub's Swift Style Guide](https://github.com/github/swift-style-guide).
**Supported Rules**:
- **Line length** should be 100 characters or less.
- **Leading whitespace** file shouldn't start with whitespace.
- **Force casts** should be avoided.
- **Trailing line whitespace** - lines should have no trailing whitespace.
- **Trailing new line** - file should have a single trailing newline.
- **File length** - file should contain 400 lines or less).
## Installation
Building SwiftLinter on macOS requires Xcode 9.4 or later or a Swift 4.1
toolchain or later with the Swift Package Manager.
### Swift Package Manager
Run `swift build` in the root directory of this project.
Debug:
```bash
$ swift build
$ .build/debug/SwiftLinter
```
Release:
```bash
$ swift build -c release -Xswiftc -static-stdlib
$ .build/release/SwiftLinter
```
## Usage
This will run SwiftLinter in the current directory containing the Swift files to lint. Directories will be searched recursively.
```bash
$ SwiftLinter
```
This will run SwiftLinter at the specified path to lint Swift files. Directories will be searched recursively.
```bash
$ SwiftLinter {YOUR_PATH}
```
## Screen Shot
