Skip to content

Commit

Permalink
Merge branch 'release/0.10.1' into versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeehut committed May 27, 2022
2 parents 5a9c6d2 + fa5343f commit 84ee29f
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 7 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ If needed, pluralize to `Tasks`, `PRs` or `Authors` and list multiple entries se
### Security
- None.

## [0.10.1] - 2022-05-27
### Changed
- Improved output color & formatting of new `--measure` option for printing execution time per check.
Author: [Cihat Gündüz](https://github.com/Jeehut)
### Fixed
- New `--measure` option did not work when no violations were found, now also prints when all checks succeed.
Author: [Cihat Gündüz](https://github.com/Jeehut)

## [0.10.0] - 2022-05-27
### Added
- New `--measure` / `-m` option to print execution times per check to find slow checks easily.
Expand Down
2 changes: 1 addition & 1 deletion Formula/anylint.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class Anylint < Formula
desc "Lint anything by combining the power of Swift & regular expressions"
homepage "https://github.com/FlineDev/AnyLint"
url "https://github.com/FlineDev/AnyLint.git", :tag => "0.9.2", :revision => "a696a4d40a3ede9daa07d7a381101a1e4e6efc46"
url "https://github.com/FlineDev/AnyLint.git", :tag => "0.10.0", :revision => "5a9c6d2289e1fc4e4f453c04d8a1ec891ea0797d"
head "https://github.com/FlineDev/AnyLint.git"

depends_on :xcode => ["12.5", :build]
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
alt="Coverage"/>
</a>
<a href="https://github.com/FlineDev/AnyLint/releases">
<img src="https://img.shields.io/badge/Version-0.10.0-blue.svg"
alt="Version: 0.10.0">
<img src="https://img.shields.io/badge/Version-0.10.1-blue.svg"
alt="Version: 0.10.1">
</a>
<a href="https://github.com/FlineDev/AnyLint/blob/main/LICENSE">
<img src="https://img.shields.io/badge/License-MIT-lightgrey.svg"
Expand Down
8 changes: 6 additions & 2 deletions Sources/AnyLint/Statistics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ final class Statistics {
showViolationsInXcode()
}
} else {
if printExecutionTime {
self.logExecutionTimes()
}

log.message(
"Performed \(executedChecks.count) check(s) in \(filesChecked.count) file(s) without any violations.",
level: .success
Expand All @@ -83,11 +87,11 @@ final class Statistics {
}

func logExecutionTimes() {
log.message("Executed checks sorted by their execution time:", level: .info)
log.message("Executed checks sorted by their execution time:", level: .info)

for (check, executionTime) in self.executionTimePerCheck.sorted(by: { $0.value > $1.value }) {
let milliseconds = Int(executionTime * 1000)
log.message("\(check.id) took \(milliseconds)ms", level: .info)
log.message("\(milliseconds)ms\t\t\(check.id)", level: .info)
}
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/Utility/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public var log = Logger(outputType: .console)
/// Constants to reference across the project.
public enum Constants {
/// The current tool version string. Conforms to SemVer 2.0.
public static let currentVersion: String = "0.10.0"
public static let currentVersion: String = "0.10.1"

/// The name of this tool.
public static let toolName: String = "AnyLint"
Expand Down
2 changes: 1 addition & 1 deletion Sources/Utility/Logger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public final class Logger {
print(formattedCurrentTime(), "", message.green)

case .info:
print(formattedCurrentTime(), "ℹ️ ", message.lightBlue)
print(formattedCurrentTime(), "ℹ️ ", message.lightCyan)

case .warning:
print(formattedCurrentTime(), "⚠️ ", message.yellow)
Expand Down

0 comments on commit 84ee29f

Please sign in to comment.