This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MARK: - Helper Functions | |
extension DangerDSL { | |
func filesWithAdditions(fileTypes: [FileType] = [.swift], excludedFiles: [File] = []) -> [String] { | |
return (git.modifiedFiles + git.createdFiles).filter { | |
guard let fileType = $0.fileType, !excludedFiles.contains($0) else { return false } | |
return fileTypes.contains(fileType) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MARK: - 1 - Pull Request Description | |
let pullRequestBody = danger.github.pullRequest.body ?? "" | |
if !pullRequestBody.contains("📲 What") || | |
!pullRequestBody.contains("👀 See") || | |
!pullRequestBody.contains("🤔 Why") || | |
!pullRequestBody.contains("🛠 How") { | |
warn(""" | |
Pull request description is missing required information: | |
- 📲 What |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MARK: - 3 - SwiftLint | |
SwiftLint.lint(inline: true, strict: true, lintAllFiles: true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MARK: - 3 - Celebrate Milestones | |
let pullRequestMilestones = [2, 10, 100] | |
let currentPRNumber = danger.github.pullRequest.number | |
if pullRequestMilestones.contains(currentPRNumber) { | |
let githubHandle = danger.github.pullRequest.user.login | |
message("Congratulations \(githubHandle)! You've made the 100th Pull Request!") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MARK: - 4 - Celebrate Milestones | |
var largePRLineCount = 500; | |
let additions: Int = danger.github.pullRequest.additions ?? 0 | |
let deletions: Int = danger.github.pullRequest.deletions ?? 0 | |
if ((additions + deletions) > largePRLineCount) { | |
warn(""" | |
Number of pull request changes is larger than 500! Consider breaking out future changes into smaller pull requests. | |
"""); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public struct GitHubPR : Decodable, Equatable { | |
public enum PullRequestState : String, Decodable { | |
case open | |
case closed | |
case merged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// The GitHub metadata for your pull request. | |
public struct GitHub : Decodable { | |
public let issue: Danger.GitHubIssue | |
public let pullRequest: Danger.GitHubPR | |
public let commits: [Danger.GitHubCommit] | |
public let reviews: [Danger.GitHubReview] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewController.swift | |
// CodeImage | |
// | |
// Created by Jonathan Samudio on 5/29/19. | |
// Copyright © 2019 Prolific Interactive. All rights reserved. | |
// | |
import Cocoa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// CanvasViewController.swift | |
// CodeDesign | |
// | |
// Created by Jonathan Samudio on 5/20/19. | |
// Copyright © 2019 JustBinary. All rights reserved. | |
// | |
import Foundation | |
import Cocoa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
import java.io.*; | |
public class Solution { | |
public static void main(String[] args) { | |
Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in))); | |
int t = in.nextInt(); | |
for (int i = 1; i <= t; ++i) { | |
int gridSize = in.nextInt(); |
NewerOlder