feat: increased swiftlint file_length rule from 600 to 800

This commit is contained in:
Serhiy Mytrovtsiy
2022-05-24 23:26:53 +02:00
parent c93f9f4e1e
commit 49164388ca
3 changed files with 7 additions and 9 deletions

View File

@@ -45,5 +45,5 @@ type_body_length:
- 400
file_length:
- 600
- 800
- 800
- 1000

View File

@@ -505,7 +505,7 @@ public class HalfCircleGraphView: NSView {
context.restoreGState()
if self.text != nil {
if let text = self.text {
let style = NSMutableParagraphStyle()
style.alignment = .center
let stringAttributes = [
@@ -514,10 +514,9 @@ public class HalfCircleGraphView: NSView {
NSAttributedString.Key.paragraphStyle: style
]
let width: CGFloat = self.text!.widthOfString(usingFont: NSFont.systemFont(ofSize: 10))
let height: CGFloat = self.text!.heightOfString(usingFont: NSFont.systemFont(ofSize: 10))
let rect = CGRect(x: ((self.frame.width-width)/2)-0.5, y: (self.frame.height-6)/2, width: width, height: height)
let str = NSAttributedString.init(string: self.text!, attributes: stringAttributes)
let width: CGFloat = text.widthOfString(usingFont: NSFont.systemFont(ofSize: 10))
let rect = CGRect(x: ((self.frame.width-width)/2)-0.5, y: (self.frame.height-6)/2, width: width, height: 13)
let str = NSAttributedString.init(string: text, attributes: stringAttributes)
str.draw(with: rect)
}
}

View File

@@ -8,7 +8,6 @@
//
// Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved.
//
// swiftlint:disable file_length
import Cocoa
import Kit
@@ -156,7 +155,7 @@ internal class SensorView: NSStackView {
self.valueView = ValueSensorView(sensor, width: width, callback: { [weak self] in
self?.open()
})
self.chartView = ChartSensorView(width: width)
self.chartView = ChartSensorView(width: width, suffix: sensor.unit)
self.addArrangedSubview(self.valueView)