Skip to content

Commit

Permalink
Update to Apodini 0.5.0 (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
PSchmiedmayer authored Aug 24, 2021
1 parent f73314c commit d813931
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 13 deletions.
24 changes: 23 additions & 1 deletion .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

# Apodini SwiftLint file Apodini

# The whitelist_rules configuration also includes rules that are enabled by default to provide a good overview of all rules.
# The only_rules configuration also includes rules that are enabled by default to provide a good overview of all rules.
only_rules:
- attributes
# Attributes should be on their own lines in functions and types, but on the same line as variables and imports.
- anyobject_protocol
# Prefer using AnyObject over class for class-only protocols.
- array_init
Expand All @@ -35,6 +36,8 @@ only_rules:
# Colons should be next to the identifier when specifying a type and next to the key in dictionary literals.
- comma
# There should be no space before and one after any comma.
- comment_spacing
# Prefer at least one space after slashes for comments.
- compiler_protocol_init
# The initializers declared in compiler protocols such as ExpressibleByArrayLiteral shouldn't be called directly.
- computed_accessors_order
Expand Down Expand Up @@ -85,6 +88,8 @@ only_rules:
# Number of associated values in an enum case should be low
- explicit_init
# Explicitly calling .init() should be avoided.
- fallthrough
# Fallthrough should be avoided.
- fatal_error_message
# A fatalError call should have a message.
- file_length
Expand Down Expand Up @@ -124,6 +129,8 @@ only_rules:
# Implicitly unwrapped optionals should be avoided when possible.
- inclusive_language
# Identifiers should use inclusive language that avoids discrimination against groups of people based on race, gender, or socioeconomic status
- indentation_width
# Indent code using either one tab or the configured amount of spaces, unindent to match previous indentations. Don’t indent the first line.
- inert_defer
# If defer is at the end of its parent scope, it will be executed right where it is anyway.
- is_disjoint
Expand Down Expand Up @@ -166,12 +173,16 @@ only_rules:
# Modifier order should be consistent.
- multiline_arguments
# Arguments should be either on the same line, or one per line.
- multiline_arguments_brackets
# Multiline arguments should have their surrounding brackets in a new line.
- multiline_function_chains
# Chained function calls should be either on the same line, or one per line.
- multiline_literal_brackets
# Multiline literals should have their surrounding brackets in a new line.
- multiline_parameters
# Functions and methods parameters should be either on the same line, or one per line.
- multiline_parameters_brackets
# Multiline parameters should have their surrounding brackets in a new line.
- nesting
# Types and functions should only be nested to a certain level deep.
# See nesting below for the exact configuration.
Expand Down Expand Up @@ -205,6 +216,8 @@ only_rules:
# Combine multiple pattern matching bindings by moving keywords out of tuples.
- prefer_self_type_over_type_of_self
# Prefer Self over type(of: self) when accessing properties or calling methods.
- prefer_zero_over_explicit_init
# Prefer .zero over explicit init with zero parameters (e.g. CGPoint(x: 0, y: 0))
- private_action
# IBActions should be private.
- private_outlet
Expand Down Expand Up @@ -249,6 +262,8 @@ only_rules:
# Test files should contain a single QuickSpec or XCTestCase class.
- sorted_first_last
# Prefer using `min()`` or `max()`` over `sorted().first` or `sorted().last`
- sorted_imports
# Imports should be sorted.
- statement_position
# Else and catch should be on the same line, one space after the previous declaration.
- static_operator
Expand Down Expand Up @@ -277,9 +292,13 @@ only_rules:
- type_body_length
# Type bodies should not span too many lines.
# See large_tuple below for the exact configuration.
- type_contents_order
# Specifies the order of subtypes, properties, methods & more within a type.
- type_name
# Type name should only contain alphanumeric characters, start with an uppercase character and span between 3 and 40 characters in length.
# Excluded types are listed below.
- unavailable_function
# Unimplemented functions should be marked as unavailable.
- unneeded_break_in_switch
# Avoid using unneeded break statements.
- unneeded_parentheses_in_closure_argument
Expand Down Expand Up @@ -317,13 +336,16 @@ only_rules:
# Don’t include vertical whitespace (empty line) after opening braces.
- void_return
# Prefer -> Void over -> ().
- xct_specific_matcher
# Prefer specific XCTest matchers over XCTAssertEqual and XCTAssertNotEqual
- xctfail_message
# An XCTFail call should include a description of the assertion.
- yoda_condition
# The variable should be placed on the left, the constant on the right of a comparison operator.

excluded: # paths to ignore during linting. Takes precedence over `included`.
- .build
- .xcodebuild
- .swiftpm

closure_body_length: # Closure bodies should not span too many lines.
Expand Down
8 changes: 4 additions & 4 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@
"repositoryURL": "https://github.com/Apodini/Apodini.git",
"state": {
"branch": null,
"revision": "452719f6cb428977f2c7d5a2eebdc41505b9267a",
"version": "0.4.1"
"revision": "e6a943b0db29b2df5c0c139ab993e57752bf22b7",
"version": "0.5.0"
}
},
{
"package": "ApodiniAsyncHTTPClient",
"repositoryURL": "https://github.com/Apodini/ApodiniAsyncHTTPClient.git",
"state": {
"branch": null,
"revision": "6a3e13802dfeab0697f20c242eddf63e35cd09f2",
"version": "0.3.0"
"revision": "cb387bdf21b8d3ded1e76bd27b3b88d59202d4c1",
"version": "0.3.1"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ let package = Package(
)
],
dependencies: [
.package(url: "https://github.com/Apodini/Apodini.git", .upToNextMinor(from: "0.4.0")),
.package(url: "https://github.com/Apodini/ApodiniAsyncHTTPClient.git", .upToNextMinor(from: "0.3.0")),
.package(url: "https://github.com/Apodini/Apodini.git", .upToNextMinor(from: "0.5.0")),
.package(url: "https://github.com/Apodini/ApodiniAsyncHTTPClient.git", .upToNextMinor(from: "0.3.1")),
.package(url: "https://github.com/Apodini/Analyst.git", .upToNextMinor(from: "0.1.0")),
.package(url: "https://github.com/apple/swift-nio.git", from: "2.30.0")
],
Expand Down
4 changes: 2 additions & 2 deletions Sources/ApodiniAnalystPresenter/Color+SystemColors.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ extension Color {
}
/// A `GraphConfiguration` with all `systemColors`
public static var systemColorGraphConfiguration: GraphConfiguration {
PrometheusGraphConfiguration(styles:
systemColors.map { color in
PrometheusGraphConfiguration(
styles: systemColors.map { color in
(.line(.init(.quadCurve, color: color, width: 2)), color)
}
)
Expand Down
4 changes: 2 additions & 2 deletions Sources/ApodiniAnalystPresenter/MetricPresenterService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
// SPDX-License-Identifier: MIT
//

import _NIOConcurrency
import AnalystPresenter
import Apodini
import ApodiniAsyncHTTPClient
import AnalystPresenter
import NIO
import _NIOConcurrency
import PrometheusAnalyst


Expand Down
2 changes: 1 addition & 1 deletion Sources/ApodiniAnalystPresenter/PresenterService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
// SPDX-License-Identifier: MIT
//

import _NIOConcurrency
import Apodini
import Foundation
import NIO
import _NIOConcurrency
import Presenter


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// SPDX-License-Identifier: MIT
//

import XCTest
@testable import ApodiniAnalystPresenter
import XCTest


final class ApodiniAnalystPresenterTests: XCTestCase {
Expand Down

0 comments on commit d813931

Please sign in to comment.