thefuntasty_danger 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/Dangerfile +48 -0
  3. metadata +101 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0c7f792b47db02ecc9a3d9fb29a8452cefb2867c
4
+ data.tar.gz: 51bebddf360ec2e05637db73cfaed85908e9762c
5
+ SHA512:
6
+ metadata.gz: 9576b8387b7ddd77cc304384de9466362660fa46ccabbd32c7d56c0e70b1c52e784018b750efcc6b8d4e34dc147da210cede378d290990cf44ed2c422c18f3e0
7
+ data.tar.gz: f2d33b17e0af0c992d075136d56cbebbffe07c345417b0a33f73354563f2772c8c5a64aa979fd7f06e6d8473df256b13138e0ab3fef1064b7de1c96a8d3a8c81
data/Dangerfile ADDED
@@ -0,0 +1,48 @@
1
+
2
+ # Configuration
3
+ jira_link = "https://thefuntasty.atlassian.net/browse/"
4
+ max_pr_length = 500
5
+
6
+ # Regular expressions for PR title and branch
7
+ title_name_check = /^([A-Z]{2,}-\d+)\s\w{2,}/
8
+ branch_jira_id_check = /^(feature|hotfix|fix)\/([A-Z]{2,})-\d+-/
9
+
10
+ # Convenience variables
11
+ has_correct_prefix = github.branch_for_head.match(/^(feature|hotfix|fix|release|housekeep)\//)
12
+ is_feature_or_fix = github.branch_for_head.match(/^(feature|hotfix|fix)\//)
13
+ can_be_merged_to_master = github.branch_for_head.match(/^(release|hotfix|)\//)
14
+ branch_contains_jira_id = github.branch_for_head.match(/^(feature|hotfix|fix)\/([A-Z]{2,}-\d+)-/)
15
+
16
+ title_contains_jira_id = github.pr_title.match(title_name_check)
17
+ is_pr_wip = github.pr_title.include? "[WIP]"
18
+
19
+ is_pr_big = git.lines_of_code > max_pr_length
20
+
21
+ # Throw errors
22
+ fail("Only hotfix and release can point to master.") if !can_be_merged_to_master and github.branch_for_base == "master"
23
+
24
+ # Throw descriptive warnings
25
+ warn("Branch name should have `release/`, `hotfix/`, `fix/`, `housekeep/` or `feature/` prefix.") if !has_correct_prefix
26
+ warn("Feature of fix pull request title should include JIRA-ID.") if is_feature_or_fix and !title_contains_jira_id
27
+ warn("Feature of fix pull request branch should include JIRA-ID.") if is_feature_or_fix and !branch_contains_jira_id
28
+ warn("Pull request is classed as Work in Progress") if is_pr_wip
29
+ warn("This pull request is too big.") if is_pr_big
30
+
31
+ # Send link to JIRA if possible
32
+ if title_contains_jira_id then
33
+ jira_id = title_contains_jira_id.captures.first
34
+ message(":large_blue_diamond: [#{jira_id}](#{jira_link}#{jira_id})")
35
+ end
36
+
37
+ # Lint files
38
+ swiftlint.binary_path = './Pods/SwiftLint/swiftlint'
39
+ swiftlint.max_num_violations = 20
40
+ swiftlint.lint_files inline_mode: true
41
+
42
+ # Ignoring warnings from Pods
43
+ xcode_summary.ignored_files = '**/Pods/**'
44
+ xcode_summary.inline_mode = true
45
+ xcode_summary.report 'build/reports/errors.json'
46
+
47
+ # Check commit messages
48
+ commit_lint.check warn: :all
metadata ADDED
@@ -0,0 +1,101 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: thefuntasty_danger
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Matěj Kašpar Jirásek
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-01-28 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: danger
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '5'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '5'
27
+ - !ruby/object:Gem::Dependency
28
+ name: danger-commit_lint
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: danger-xcode_summary
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: danger-swiftlint
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: Danger configuration used at The Funtasty, currently mainly for iOS development
70
+ email:
71
+ - matej.jirasek@thefuntasty.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - Dangerfile
77
+ homepage: https://github.com/thefuntasty/danger
78
+ licenses:
79
+ - MIT
80
+ metadata: {}
81
+ post_install_message:
82
+ rdoc_options: []
83
+ require_paths:
84
+ - lib
85
+ required_ruby_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ required_rubygems_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ requirements: []
96
+ rubyforge_project:
97
+ rubygems_version: 2.4.8
98
+ signing_key:
99
+ specification_version: 4
100
+ summary: The Danger rules we use @ The Funtasty
101
+ test_files: []