Skip to content

Commit

Permalink
Added codespell workflow which replaces misspell (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
mburumaxwell authored Mar 12, 2024
1 parent 1c067f7 commit 19fff70
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 30 deletions.
4 changes: 4 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[codespell]
skip = .git
# some modules, parts of regexes, and variable names to ignore
ignore-words-list = inout
21 changes: 21 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Codespell

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Codespell
uses: codespell-project/actions-codespell@v2
20 changes: 0 additions & 20 deletions .github/workflows/misspell.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public final class SharedKeyAuthenticationProvider: AuthenticationHeaderProvider
* - Parameter method: The HTTP request method
* - Parameter contentLength: The value for the `Content-Length`header
* - Parameter contentType: The value for the `Content-Type`header
* - Parameter date: The date alue used to make the request, set in the header with key specified by `dateHeaderName`
* - Parameter date: The date value used to make the request, set in the header with key specified by `dateHeaderName`
* - Parameter resource: The resource that is being accessed
*/
private func sign(method: String, contentLength: Int64, contentType: String, date: String, resource: String) -> String? {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Int+Extenstion.swift
// Int+Extension.swift
//
//
// Created by Maxwell Weru on 5/28/20.
Expand All @@ -13,15 +13,15 @@ extension Int {
func formatAbbreviated () -> String {
let numFormatter = NumberFormatter()

typealias Abbrevation = (threshold:Double, divisor:Double, suffix:String)
let abbreviations:[Abbrevation] = [(0, 1, ""),
typealias Abbreviation = (threshold:Double, divisor:Double, suffix:String)
let abbreviations:[Abbreviation] = [(0, 1, ""),
(1000.0, 1000.0, "K"),
(100_000.0, 1_000_000.0, "M"),
(100_000_000.0, 1_000_000_000.0, "B"),
(100_000_000_000.0, 1_000_000_000_000.0, "T")]
// you can add more !
let startValue = Double (abs(self))
let abbreviation:Abbrevation = {
let abbreviation:Abbreviation = {
var prevAbbreviation = abbreviations[0]
for tmpAbbreviation in abbreviations {
if (startValue < tmpAbbreviation.threshold) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public final class AppDetailsMiddleware: TingleApiClientMiddleware {
private let appKind: String

/**
* Intitialize and instance of `AppDetailsMiddleware`
* Initialize and instance of `AppDetailsMiddleware`
*
* - Parameter bundleId: The identifier of the application bundle
* - Parameter shortBundleVersion: The short version of the application bundle
Expand Down
2 changes: 1 addition & 1 deletion Sources/TingleApiClient/Middleware/LoggingMiddleware.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public final class LoggingMiddleware: TingleApiClientMiddleware {
*
* - Parameter level: The level of data from a request/response to log. This defaults to `.NONE`.
* - Parameter logLevel: The logging level to use when writing the logs to the output. This depends on the logging implementation in use. The default level is `.trace`
* - Parameter loggerLabel: The lable to use for use when logging. This is useful for filtering logs. When not provided, it defaults to the name of this class i.e.`String(describing: LoggingMiddleware.self)`
* - Parameter loggerLabel: The label to use for use when logging. This is useful for filtering logs. When not provided, it defaults to the name of this class i.e.`String(describing: LoggingMiddleware.self)`
*/
public init(_ level: Level = .NONE, _ logLevel: Logger.Level = Logger.Level.trace, loggerLabel: String = String(describing: LoggingMiddleware.self)) {
self.logger = Logger(label: loggerLabel)
Expand Down
2 changes: 1 addition & 1 deletion Sources/TingleApiClient/MultipartBody.swift
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public class MultipartBody{


public func build() throws -> MultipartBody {
if parts.isEmpty{ fatalError("Mutlipart body must have at least one part")}
if parts.isEmpty{ fatalError("Multipart body must have at least one part")}
return MultipartBody(boundary: boundary, type: type, parts: parts)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import XCTest
@testable import TingleApiClient

class MutlipartBodyTests: XCTestCase{
class MultipartBodyTests: XCTestCase{
func testSerializationOfFormData(){
let url = URL(string: "www.example.com")!
var request = URLRequest(url: url)
request.httpMethod = "POST"

let body = try! MultipartBody.Builder(&request, type: .FORM)
.addFormDataPart(name: "Currecny", value:"USD")
.addFormDataPart(name: "Currency", value:"USD")
.addFormDataPart(name: "Amount", value: "1234")
.build()

Expand Down

0 comments on commit 19fff70

Please sign in to comment.