<commit_before>import Foundation

// http://benscheirman.com/2017/06/ultimate-guide-to-json-parsing-with-swift-4/
// http://danger.systems/js/reference.html

public struct DangerDSL: Decodable {
    public let git: Git
    public let github: GitHub
}

public struct Git: Decodable {
    enum CodingKeys: String, CodingKey {
        case modifiedFiles = "modified_files"
        case createdFiles = "created_files"
        case deletedFiles = "deleted_files"
    }

    public let modifiedFiles: [String]
    public let createdFiles: [String]
    public let deletedFiles: [String]
}

public struct GitHub: Decodable {

    enum CodingKeys: String, CodingKey {
        case pullRequest = "pr"
    }

    public let pullRequest: GitHubPR
}

// MARK: - GitHubPR

public struct GitHubPR: Decodable {

    // MARK: - CodingKeys

    enum CodingKeys: String, CodingKey {
        case number
        case title
        case body
        case user
        case assignee
        case assignees
        case additions
        case deletions
        case state
        case isLocked = "locked"
        case isMerged = "merged"
        case createdAt = "created_at"
        case updatedAt = "updated_at"
        case closedAt = "closed_at"
        case mergedAt = "merged_at"
        case commitCount = "commits"
        case commentCount = "comments"
        case reviewCommentCount = "review_comments"
        case changedFiles = "changed_files"

    }

    // MARK: - State

    public enum State: String, Decodable {
        case open
        case closed
        case merged
        case locked
    }

    // MARK: - Properties

    /// The number of the pull request
    public let number: Int

    /// The title of the pull request
    public let title: String

    /// The markdown body message of the pull request
    public let body: String

    /// The user who submitted the pull request
    public let user: GitHubUser

    /// The user who is assigned to the pull request
    public let assignee: GitHubUser

    /// The users who are assigned to the pull request
    public let assignees: [GitHubUser]

    /// The ISO6801 date string for when the pull request was created.
    public let createdAt: String

    /// The ISO6801 date string for when the pull request was updated.
    public let updatedAt: String

    /// The ISO6801 date string for when the pull request was closed.
    public let closedAt: String?

    /// The ISO6801 date string for when the pull request was merged.
    public let mergedAt: String?

    /// The state for the pull request: open, closed, locked, merged.
    public let state: State

    /// A boolean indicating if the pull request has been locked to contributors only.
    public let isLocked: Bool

    /// A boolean indicating if the pull request has been merged.<commit_msg>Relax the typing on assignees<commit_after>import Foundation

// http://benscheirman.com/2017/06/ultimate-guide-to-json-parsing-with-swift-4/
// http://danger.systems/js/reference.html

public struct DangerDSL: Decodable {
    public let git: Git
    public let github: GitHub
}

public struct Git: Decodable {
    enum CodingKeys: String, CodingKey {
        case modifiedFiles = "modified_files"
        case createdFiles = "created_files"
        case deletedFiles = "deleted_files"
    }

    public let modifiedFiles: [String]
    public let createdFiles: [String]
    public let deletedFiles: [String]
}

public struct GitHub: Decodable {

    enum CodingKeys: String, CodingKey {
        case pullRequest = "pr"
    }

    public let pullRequest: GitHubPR
}

// MARK: - GitHubPR

public struct GitHubPR: Decodable {

    // MARK: - CodingKeys

    enum CodingKeys: String, CodingKey {
        case number
        case title
        case body
        case user
        case assignee
        case assignees
        case additions
        case deletions
        case state
        case isLocked = "locked"
        case isMerged = "merged"
        case createdAt = "created_at"
        case updatedAt = "updated_at"
        case closedAt = "closed_at"
        case mergedAt = "merged_at"
        case commitCount = "commits"
        case commentCount = "comments"
        case reviewCommentCount = "review_comments"
        case changedFiles = "changed_files"

    }

    // MARK: - State

    public enum State: String, Decodable {
        case open
        case closed
        case merged
        case locked
    }

    // MARK: - Properties

    /// The number of the pull request
    public let number: Int

    /// The title of the pull request
    public let title: String

    /// The markdown body message of the pull request
    public let body: String

    /// The user who submitted the pull request
    public let user: GitHubUser

    /// The user who is assigned to the pull request
    public let assignee: GitHubUser?

    /// The users who are assigned to the pull request
    public let assignees: [GitHubUser]

    /// The ISO6801 date string for when the pull request was created.
    public let createdAt: String

    /// The ISO6801 date string for when the pull request was updated.
    public let updatedAt: String

    /// The ISO6801 date string for when the pull request was closed.
    public let closedAt: String?

    /// The ISO6801 date string for when the pull request was merged.
    public let mergedAt: String?

    /// The state for the pull request: open, closed, locked, merged.
    public let state: State

    /// A boolean indicating if the pull request has been locked to contributors only.
    public let isLocked: Bool

    /// A boolean indicating if the pull request has been merged.
{'fraction_non_alphanumeric': 0.06815365551425032, 'fraction_numerical': 0.008143034165338998, 'mean_word_length': 2.3060269163253366, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1052735', 'n_tokens_mistral': 1600, 'n_tokens_neox': 1484, 'n_words': 617}