danger-pivotal_tracker 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/CODEOWNERS +6 -0
- data/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +24 -0
- data/.github/mergeable.yml +26 -0
- data/.github/pull_request_template.md +20 -0
- data/.gitignore +5 -0
- data/.rubocop.yml +163 -0
- data/.travis.yml +55 -0
- data/CODE_OF_CONDUCT.md +76 -0
- data/Dangerfile +80 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +148 -0
- data/Guardfile +19 -0
- data/LICENSE.txt +22 -0
- data/README.md +58 -0
- data/Rakefile +23 -0
- data/danger-pivotal_tracker.gemspec +50 -0
- data/docs/images/walter-code-cov.jpeg +0 -0
- data/lib/danger_pivotal_tracker.rb +3 -0
- data/lib/danger_plugin.rb +3 -0
- data/lib/pivotal_tracker/gem_version.rb +5 -0
- data/lib/pivotal_tracker/plugin.rb +134 -0
- data/spec/fixtures/github_pr.json +366 -0
- data/spec/pivotal_tracker_spec.rb +105 -0
- data/spec/spec_helper.rb +70 -0
- data/spec/support/fixtures/github_pr.json +366 -0
- metadata +214 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5e9b00050269edf418c1b7b44340d9f6cf66b5cf41111737433744d4a2f4a6eb
|
4
|
+
data.tar.gz: 0f7e9a2de01a5475e9d5d82f1bb037979e65758b5dc1530aa551eacc390427fb
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7d82a1f9dcf702fbaf5e95463da4906840ad1d654c300b70365e6583ba52eb206b3dbd56777a39c53054d8037935fb9483d6f7ec3b98f4482ca699fed92bcdec
|
7
|
+
data.tar.gz: b07f05c8ddd10617feee4c6df9dd3d0ae66da9185e6d606ca0d97db8062f79e5a35c8fa252680afdd4753d94e09a3208c2c9c09874d3212d37b779783c5e18ad
|
data/.github/CODEOWNERS
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
name: Bug report
|
3
|
+
about: Create a report to help us improve
|
4
|
+
title: ''
|
5
|
+
labels: ''
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
**Describe the bug**
|
11
|
+
A clear and concise description of what the bug is.
|
12
|
+
|
13
|
+
**To Reproduce**
|
14
|
+
Steps to reproduce the behavior:
|
15
|
+
1. Go to '...'
|
16
|
+
2. Click on '....'
|
17
|
+
3. Scroll down to '....'
|
18
|
+
4. See error
|
19
|
+
|
20
|
+
**Expected behavior**
|
21
|
+
A clear and concise description of what you expected to happen.
|
22
|
+
|
23
|
+
**Screenshots**
|
24
|
+
If applicable, add screenshots to help explain your problem.
|
25
|
+
|
26
|
+
**Desktop (please complete the following information):**
|
27
|
+
- OS: [e.g. iOS]
|
28
|
+
- Browser [e.g. chrome, safari]
|
29
|
+
- Version [e.g. 22]
|
30
|
+
|
31
|
+
**Smartphone (please complete the following information):**
|
32
|
+
- Device: [e.g. iPhone6]
|
33
|
+
- OS: [e.g. iOS8.1]
|
34
|
+
- Browser [e.g. stock browser, safari]
|
35
|
+
- Version [e.g. 22]
|
36
|
+
|
37
|
+
**Additional context**
|
38
|
+
Add any other context about the problem here.
|
@@ -0,0 +1,24 @@
|
|
1
|
+
---
|
2
|
+
name: Feature request
|
3
|
+
about: Suggest an idea for this project
|
4
|
+
title: ''
|
5
|
+
labels: ''
|
6
|
+
assignees: ''
|
7
|
+
---
|
8
|
+
|
9
|
+
<!-- Thanks for contributing! When submitting an issue please ensure you check the following checklist items. -->
|
10
|
+
|
11
|
+
### Checklist 📋
|
12
|
+
|
13
|
+
- [ ] I have read the [README](https://github.com/kevnm67/danger-pivotal_tracker/blob/master/README.md)
|
14
|
+
- [ ] I have searched issues (open/closed) (e.g. ensured my request hasn't been done/not in progress).
|
15
|
+
|
16
|
+
### Environment 🗻
|
17
|
+
|
18
|
+
<!-- Include any relevant information below. -->
|
19
|
+
|
20
|
+
- Ruby version: [ENTER_VERSION_HERE]
|
21
|
+
|
22
|
+
### Description 🖋
|
23
|
+
|
24
|
+
<!-- Please describe your idea below. -->
|
@@ -0,0 +1,26 @@
|
|
1
|
+
version: 2
|
2
|
+
mergeable:
|
3
|
+
- when: pull_request.*, issues.*
|
4
|
+
validate:
|
5
|
+
- do: title
|
6
|
+
no_empty:
|
7
|
+
enabled: true
|
8
|
+
message: 'Custom message...'
|
9
|
+
must_exclude:
|
10
|
+
regex: ^\[WIP\]
|
11
|
+
- do: label
|
12
|
+
must_exclude:
|
13
|
+
regex: 'wip'
|
14
|
+
- do: stale
|
15
|
+
days: 7
|
16
|
+
message: 'This is PR getting stale. Please follow up! This is a friendly reminder to please resolve it. :-)'
|
17
|
+
type: pull_request, issues
|
18
|
+
|
19
|
+
- when: pull_request.*
|
20
|
+
validate:
|
21
|
+
- do: approvals
|
22
|
+
min:
|
23
|
+
count: 1
|
24
|
+
message: 'Waiting on approvals... '
|
25
|
+
required:
|
26
|
+
reviewers: [ kevnm67 ]
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<!-- Uncomment if related to your PR. -->
|
2
|
+
<!-- ### Issue Link :link: -->
|
3
|
+
<!-- Please link a github issue if not associated with a pivotal tracker/JIRA/etc. story. -->
|
4
|
+
|
5
|
+
### Goals :soccer:
|
6
|
+
<!-- List the high-level objectives of this pull request. -->
|
7
|
+
<!-- Include any relevant context. -->
|
8
|
+
|
9
|
+
### Implementation Details :construction:
|
10
|
+
<!-- Explain the reasoning behind any architectural changes. -->
|
11
|
+
<!-- Highlight any new functionality. -->
|
12
|
+
|
13
|
+
<!-- ### Testing Details :mag: -->
|
14
|
+
<!-- Describe what tests you've added for your changes. -->
|
15
|
+
|
16
|
+
### Checklist:
|
17
|
+
|
18
|
+
- [ ] **Added test coverage**
|
19
|
+
- [ ] I tested and reviewed my code.
|
20
|
+
- [ ] I added comments/documentation.
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,163 @@
|
|
1
|
+
# Defaults can be found here: https://github.com/bbatsov/rubocop/blob/master/config/default.yml
|
2
|
+
|
3
|
+
# If you don't like these settings, just delete this file :)
|
4
|
+
|
5
|
+
AllCops:
|
6
|
+
Exclude:
|
7
|
+
- 'vendor/**/*'
|
8
|
+
- 'spec/fixtures/**/*'
|
9
|
+
- 'tmp/**/*'
|
10
|
+
TargetRubyVersion: 2.3
|
11
|
+
|
12
|
+
Style/StringLiterals:
|
13
|
+
EnforcedStyle: double_quotes
|
14
|
+
Enabled: true
|
15
|
+
|
16
|
+
# kind_of? is a good way to check a type
|
17
|
+
Style/ClassCheck:
|
18
|
+
EnforcedStyle: kind_of?
|
19
|
+
|
20
|
+
# It's better to be more explicit about the type
|
21
|
+
Style/BracesAroundHashParameters:
|
22
|
+
Enabled: false
|
23
|
+
|
24
|
+
# specs sometimes have useless assignments, which is fine
|
25
|
+
Lint/UselessAssignment:
|
26
|
+
Exclude:
|
27
|
+
- '**/spec/**/*'
|
28
|
+
|
29
|
+
Layout/AccessModifierIndentation:
|
30
|
+
Enabled: true
|
31
|
+
|
32
|
+
Layout/AlignHash:
|
33
|
+
EnforcedHashRocketStyle:
|
34
|
+
- key
|
35
|
+
- table
|
36
|
+
EnforcedColonStyle:
|
37
|
+
- key
|
38
|
+
- table
|
39
|
+
|
40
|
+
# HoundCI doesn't like this rule
|
41
|
+
Layout/DotPosition:
|
42
|
+
Enabled: false
|
43
|
+
|
44
|
+
Layout/EmptyLineAfterMagicComment:
|
45
|
+
Enabled: true
|
46
|
+
|
47
|
+
# We allow !! as it's an easy way to convert ot boolean
|
48
|
+
Style/DoubleNegation:
|
49
|
+
Enabled: false
|
50
|
+
|
51
|
+
# Cop supports --auto-correct.
|
52
|
+
Lint/UnusedBlockArgument:
|
53
|
+
Enabled: false
|
54
|
+
|
55
|
+
# We want to allow class Fastlane::Class
|
56
|
+
Style/ClassAndModuleChildren:
|
57
|
+
Enabled: false
|
58
|
+
|
59
|
+
Metrics/AbcSize:
|
60
|
+
Max: 60
|
61
|
+
|
62
|
+
# The %w might be confusing for new users
|
63
|
+
Style/WordArray:
|
64
|
+
MinSize: 19
|
65
|
+
|
66
|
+
# raise and fail are both okay
|
67
|
+
Style/SignalException:
|
68
|
+
Enabled: false
|
69
|
+
|
70
|
+
# Better too much 'return' than one missing
|
71
|
+
Style/RedundantReturn:
|
72
|
+
Enabled: false
|
73
|
+
|
74
|
+
# Having if in the same line might not always be good
|
75
|
+
Style/IfUnlessModifier:
|
76
|
+
Enabled: false
|
77
|
+
|
78
|
+
# and and or is okay
|
79
|
+
Style/AndOr:
|
80
|
+
Enabled: false
|
81
|
+
|
82
|
+
# Configuration parameters: CountComments.
|
83
|
+
Metrics/ClassLength:
|
84
|
+
Max: 350
|
85
|
+
|
86
|
+
Metrics/CyclomaticComplexity:
|
87
|
+
Max: 17
|
88
|
+
|
89
|
+
# Configuration parameters: AllowURI, URISchemes.
|
90
|
+
Metrics/LineLength:
|
91
|
+
Max: 370
|
92
|
+
|
93
|
+
# Configuration parameters: CountKeywordArgs.
|
94
|
+
Metrics/ParameterLists:
|
95
|
+
Max: 10
|
96
|
+
|
97
|
+
Metrics/PerceivedComplexity:
|
98
|
+
Max: 18
|
99
|
+
|
100
|
+
# Sometimes it's easier to read without guards
|
101
|
+
Style/GuardClause:
|
102
|
+
Enabled: false
|
103
|
+
|
104
|
+
# something = if something_else
|
105
|
+
# that's confusing
|
106
|
+
Style/ConditionalAssignment:
|
107
|
+
Enabled: false
|
108
|
+
|
109
|
+
# Better to have too much self than missing a self
|
110
|
+
Style/RedundantSelf:
|
111
|
+
Enabled: false
|
112
|
+
|
113
|
+
Metrics/MethodLength:
|
114
|
+
Max: 60
|
115
|
+
|
116
|
+
# We're not there yet
|
117
|
+
Style/Documentation:
|
118
|
+
Enabled: false
|
119
|
+
|
120
|
+
# Adds complexity
|
121
|
+
Style/IfInsideElse:
|
122
|
+
Enabled: false
|
123
|
+
|
124
|
+
# danger specific
|
125
|
+
|
126
|
+
Style/BlockComments:
|
127
|
+
Enabled: false
|
128
|
+
|
129
|
+
Layout/MultilineMethodCallIndentation:
|
130
|
+
EnforcedStyle: indented
|
131
|
+
|
132
|
+
# FIXME: 25
|
133
|
+
Metrics/BlockLength:
|
134
|
+
Max: 345
|
135
|
+
Exclude:
|
136
|
+
- "**/*_spec.rb"
|
137
|
+
|
138
|
+
Style/MixinGrouping:
|
139
|
+
Enabled: false
|
140
|
+
|
141
|
+
Naming/FileName:
|
142
|
+
Enabled: false
|
143
|
+
|
144
|
+
Layout/IndentHeredoc:
|
145
|
+
Enabled: false
|
146
|
+
|
147
|
+
Style/SpecialGlobalVars:
|
148
|
+
Enabled: false
|
149
|
+
|
150
|
+
PercentLiteralDelimiters:
|
151
|
+
PreferredDelimiters:
|
152
|
+
"%": ()
|
153
|
+
"%i": ()
|
154
|
+
"%q": ()
|
155
|
+
"%Q": ()
|
156
|
+
"%r": "{}"
|
157
|
+
"%s": ()
|
158
|
+
"%w": ()
|
159
|
+
"%W": ()
|
160
|
+
"%x": ()
|
161
|
+
|
162
|
+
Security/YAMLLoad:
|
163
|
+
Enabled: false
|
data/.travis.yml
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
language: ruby
|
2
|
+
|
3
|
+
env:
|
4
|
+
global:
|
5
|
+
- LC_CTYPE=en_US.UTF-8 LANG=en_US.UTF-8
|
6
|
+
|
7
|
+
before_install:
|
8
|
+
- gem install bundler
|
9
|
+
- bundle install --without=documentation
|
10
|
+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
11
|
+
- chmod +x ./cc-test-reporter
|
12
|
+
|
13
|
+
jobs:
|
14
|
+
include:
|
15
|
+
- &test
|
16
|
+
stage: test
|
17
|
+
name: RVM 2.0
|
18
|
+
rvm:: 2.0
|
19
|
+
before_script:
|
20
|
+
- ./cc-test-reporter before-build
|
21
|
+
script:
|
22
|
+
- bundle exec rake spec
|
23
|
+
- bundle exec danger
|
24
|
+
after_script:
|
25
|
+
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|
26
|
+
|
27
|
+
- <<: *test
|
28
|
+
name: RVM 2.3.1
|
29
|
+
rvm:: 2.3.1
|
30
|
+
|
31
|
+
- <<: *test
|
32
|
+
name: RVM 2.5.1
|
33
|
+
rvm:: 2.5.1
|
34
|
+
|
35
|
+
- <<: *test
|
36
|
+
name: RVM 2.6.0
|
37
|
+
rvm:: 2.6.0
|
38
|
+
|
39
|
+
stages:
|
40
|
+
- test
|
41
|
+
|
42
|
+
branches:
|
43
|
+
only:
|
44
|
+
- master
|
45
|
+
- develop
|
46
|
+
except:
|
47
|
+
- "/^[^\\/]+\\/\\d+(?:\\.\\d+)+\\/\\d+$/"
|
48
|
+
|
49
|
+
cache:
|
50
|
+
bundler: true
|
51
|
+
pip: true
|
52
|
+
directories:
|
53
|
+
- $HOME/vendor/bundle/
|
54
|
+
- $HOME/.rvm/
|
55
|
+
- $HOME/Library/Caches/Homebrew
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
9
|
+
level of experience, education, socio-economic status, nationality, personal
|
10
|
+
appearance, race, religion, or sexual identity and orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at kevnm67@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
72
|
+
|
73
|
+
[homepage]: https://www.contributor-covenant.org
|
74
|
+
|
75
|
+
For answers to common questions about this code of conduct, see
|
76
|
+
https://www.contributor-covenant.org/faq
|
data/Dangerfile
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
|
2
|
+
lib_has_changes = !git.modified_files.grep(/lib/).empty?
|
3
|
+
|
4
|
+
###
|
5
|
+
### Files to warn if changed:
|
6
|
+
###
|
7
|
+
|
8
|
+
@GL_DANGER_CI_CD_FILES = ['.travis.yml', 'Dangerfile']
|
9
|
+
@GL_DANGER_DEPENDENCY_FILES = ['Gemfile']
|
10
|
+
|
11
|
+
# determine if any of the files were modified
|
12
|
+
def didModify(files_array)
|
13
|
+
did_modify_files = false
|
14
|
+
files_array.each do |file_name|
|
15
|
+
if git.modified_files.include?(file_name) || git.deleted_files.include?(file_name)
|
16
|
+
did_modify_files = true
|
17
|
+
|
18
|
+
config_files = git.modified_files.select { |path| path.include? file_name }
|
19
|
+
|
20
|
+
message "This PR changes #{ github.html_link(config_files) }"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
return did_modify_files
|
25
|
+
end
|
26
|
+
|
27
|
+
# Checks if the 'given' string contains any string in the string_array.
|
28
|
+
def contains_string(given, string_array)
|
29
|
+
is_present = false
|
30
|
+
string_array.each do |file_name|
|
31
|
+
is_present = true if given.downcase.include? file_name.downcase
|
32
|
+
end
|
33
|
+
|
34
|
+
is_present
|
35
|
+
end
|
36
|
+
|
37
|
+
warn('Changes to CI/CD files') if didModify(@GL_DANGER_CI_CD_FILES)
|
38
|
+
warn('Changes to dependency related files') if didModify(@GL_DANGER_DEPENDENCY_FILES)
|
39
|
+
|
40
|
+
# Sometimes it's a README fix, or something like that - which isn't relevant for
|
41
|
+
# including in a project's CHANGELOG for example
|
42
|
+
not_declared_trivial = !(github.pr_title.downcase.include? "#trivial")
|
43
|
+
|
44
|
+
# Make it more obvious that a PR is a work in progress and shouldn't be merged yet
|
45
|
+
warn("PR is classed as Work in Progress") if github.pr_title.include? "[WIP]"
|
46
|
+
|
47
|
+
###
|
48
|
+
### Auto label
|
49
|
+
###
|
50
|
+
|
51
|
+
if github.pr_title.include? "[WIP]"
|
52
|
+
auto_label.wip=(github.pr_json["number"])
|
53
|
+
else
|
54
|
+
auto_label.remove("WIP")
|
55
|
+
end
|
56
|
+
|
57
|
+
###
|
58
|
+
### General warnings
|
59
|
+
###
|
60
|
+
|
61
|
+
warn('Big PR, try to keep changes smaller if you can') if git.lines_of_code > 500
|
62
|
+
|
63
|
+
# Changelog entries are required for changes to library files.
|
64
|
+
no_changelog_entry = !git.modified_files.include?("CHANGELOG.md")
|
65
|
+
|
66
|
+
# Dont warn about changelog until we decide on our process.
|
67
|
+
temp_skip_changelog = true
|
68
|
+
|
69
|
+
if lib_has_changes && no_changelog_entry && not_declared_trivial && !temp_skip_changelog
|
70
|
+
warn("Any changes to library code should be reflected in the Changelog. Please consider adding a note there and adhere to the [Changelog Guidelines](https://github.com/kevnm67/danger-pivotal_tracker/wiki/Changelog).")
|
71
|
+
end
|
72
|
+
|
73
|
+
# Warn when library files changed without test coverage.
|
74
|
+
tests_updated = !git.modified_files.grep(/spec/).empty?
|
75
|
+
|
76
|
+
if lib_has_changes && !tests_updated
|
77
|
+
warn("Library files were updated without test coverage. Consider updating or adding tests to cover changes.")
|
78
|
+
end
|
79
|
+
|
80
|
+
pivotal_tracker.check(project_id: "9990011")
|