slack-ruby-danger 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: acea160df15944af85379bea70db409a2b12b845
4
+ data.tar.gz: 687d9d8c08e6228c1c0eaeeb2fca07568e4da4d7
5
+ SHA512:
6
+ metadata.gz: f38fec43f9d3f50237818ec070128107f8112a7e93af004b4b323304e2956f4d8b74e5179ae6075753487248d0f76acbbcd142c1d5b08e44fb79b4a348aec8f7
7
+ data.tar.gz: 52370a3181a7bdf32eef23054647afb4cd3560c43d1366ddca12738bd13bace92c91b5af4ed8d2f6a0c6494ccdafa5ef11c7df5098722e9d2c575b1e22ed4e8f
@@ -0,0 +1,3 @@
1
+ Gemfile.lock
2
+ .bundle
3
+ pkg
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format=documentation
2
+ --color
@@ -0,0 +1,10 @@
1
+ AllCops:
2
+ Include:
3
+ - Dangerfile
4
+ - Rakefile
5
+
6
+ Style/SignalException:
7
+ Exclude:
8
+ - 'Dangerfile'
9
+
10
+ inherit_from: .rubocop_todo.yml
@@ -0,0 +1,13 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2016-07-30 11:43:22 -0400 using RuboCop version 0.42.0.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 18
10
+ # Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
11
+ # URISchemes: http, https
12
+ Metrics/LineLength:
13
+ Max: 195
@@ -0,0 +1,8 @@
1
+ language: ruby
2
+
3
+ sudo: false
4
+
5
+ rvm: 2.3.1
6
+
7
+ before_script:
8
+ - bundle exec danger
@@ -0,0 +1,6 @@
1
+ ### Changelog
2
+
3
+ #### 0.1.0 (9/5/2016)
4
+
5
+ * [#3](https://github.com/slack-ruby/danger/pull/3): Turn this project into the slack-ruby-danger gem - [@dblock](https://github.com/dblock).
6
+ * [#2](https://github.com/slack-ruby/danger/pull/2): Use the danger-changelog plugin - [@dblock](https://github.com/dblock).
@@ -0,0 +1,99 @@
1
+ Contributing to Slack-Ruby's Dangerfile
2
+ =======================================
3
+
4
+ You're encouraged to submit [pull requests](https://github.com/slack-ruby/danger/pulls), [propose features and discuss issues](https://github.com/slack-ruby/danger/issues).
5
+
6
+ #### Fork the Project
7
+
8
+ Fork the [project on Github](https://github.com/slack-ruby/danger) and check out your copy.
9
+
10
+ ```
11
+ git clone https://github.com/contributor/danger.git
12
+ cd danger
13
+ git remote add upstream https://github.com/slack-ruby/danger.git
14
+ ```
15
+
16
+ #### Create a Topic Branch
17
+
18
+ Make sure your fork is up-to-date and create a topic branch for your feature or bug fix.
19
+
20
+ ```
21
+ git checkout master
22
+ git pull upstream master
23
+ git checkout -b my-feature-branch
24
+ ```
25
+
26
+ #### Update Dangerfile
27
+
28
+ Implement your feature in Dangerfile.
29
+
30
+ Ruby style is enforced with [Rubocop](https://github.com/bbatsov/rubocop), run `bundle exec rubocop -a`, then `bundle exec rubocop` and fix any style issues highlighted.
31
+
32
+ Make sure that `bundle exec rake` completes without errors.
33
+
34
+ #### Update Changelog
35
+
36
+ Add a line to [CHANGELOG](CHANGELOG.md). Make it look like every other line, including your name and link to your Github account.
37
+
38
+ #### Commit Changes
39
+
40
+ Make sure git knows your name and email address:
41
+
42
+ ```
43
+ git config --global user.name "Your Name"
44
+ git config --global user.email "contributor@example.com"
45
+ ```
46
+
47
+ Writing good commit logs is important. A commit log should describe what changed and why.
48
+
49
+ ```
50
+ git add ...
51
+ git commit
52
+ ```
53
+
54
+ #### Push
55
+
56
+ ```
57
+ git push origin my-feature-branch
58
+ ```
59
+
60
+ #### Make a Pull Request
61
+
62
+ Go to https://github.com/contributor/danger and select your feature branch. Click the 'Pull Request' button and fill out the form. Pull requests are usually reviewed within a few days.
63
+
64
+ #### Rebase
65
+
66
+ If you've been working on a change for a while, rebase with upstream/master.
67
+
68
+ ```
69
+ git fetch upstream
70
+ git rebase upstream/master
71
+ git push origin my-feature-branch -f
72
+ ```
73
+
74
+ #### Update CHANGELOG Again
75
+
76
+ Update the [CHANGELOG](CHANGELOG.md) with the pull request number. A typical entry looks as follows.
77
+
78
+ ```
79
+ * [#123](https://github.com/slack-ruby/danger/pull/123): Reticulated splines - [@contributor](https://github.com/contributor).
80
+ ```
81
+
82
+ Amend your previous commit and force push the changes.
83
+
84
+ ```
85
+ git commit --amend
86
+ git push origin my-feature-branch -f
87
+ ```
88
+
89
+ #### Check on Your Pull Request
90
+
91
+ Go back to your pull request after a few minutes and see whether it passed muster with Travis-CI. Everything should look green, otherwise fix issues and amend your commit as described above.
92
+
93
+ #### Be Patient
94
+
95
+ It's likely that your change will not be merged and that the nitpicky maintainers will ask you to do more, or fix seemingly benign problems. Hang on there!
96
+
97
+ #### Thank You
98
+
99
+ Please do know that we really appreciate and value your time and work. We love you, really.
@@ -0,0 +1,38 @@
1
+ # --------------------------------------------------------------------------------------------------------------------
2
+ # Has any changes happened inside the actual library code?
3
+ # --------------------------------------------------------------------------------------------------------------------
4
+ has_app_changes = !git.modified_files.grep(/lib/).empty?
5
+ has_spec_changes = !git.modified_files.grep(/spec/).empty?
6
+
7
+ # --------------------------------------------------------------------------------------------------------------------
8
+ # You've made changes to lib, but didn't write any tests?
9
+ # --------------------------------------------------------------------------------------------------------------------
10
+ if has_app_changes && !has_spec_changes
11
+ warn("There're library changes, but not tests. That's OK as long as you're refactoring existing code.", sticky: false)
12
+ end
13
+
14
+ # --------------------------------------------------------------------------------------------------------------------
15
+ # You've made changes to specs, but no library code has changed?
16
+ # --------------------------------------------------------------------------------------------------------------------
17
+ if !has_app_changes && has_spec_changes
18
+ message('We really appreciate pull requests that demonstrate issues, even without a fix. That said, the next step is to try and fix the failing tests!', sticky: false)
19
+ end
20
+
21
+ # --------------------------------------------------------------------------------------------------------------------
22
+ # Have you updated CHANGELOG.md?
23
+ # --------------------------------------------------------------------------------------------------------------------
24
+ changelog.check
25
+
26
+ # --------------------------------------------------------------------------------------------------------------------
27
+ # Don't let testing shortcuts get into master by accident,
28
+ # ensuring that we don't get green builds based on a subset of tests.
29
+ # --------------------------------------------------------------------------------------------------------------------
30
+
31
+ (git.modified_files + git.added_files - %w(Dangerfile)).each do |file|
32
+ next unless File.file?(file)
33
+ contents = File.read(file)
34
+ if file.start_with?('spec')
35
+ fail("`xit` or `fit` left in tests (#{file})") if contents =~ /^\w*[xf]it/
36
+ fail("`fdescribe` left in tests (#{file})") if contents =~ /^\w*fdescribe/
37
+ end
38
+ end
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ gem 'rubocop', '0.42.0'
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2016 Daniel Doubrovkine and Contributors.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,50 @@
1
+ ## Danger
2
+
3
+ [Danger](http://danger.systems) runs during Slack Ruby projects' CI process, and gives you a chance to automate common code review chores.
4
+
5
+ [![Build Status](https://travis-ci.org/slack-ruby/danger.svg?branch=master)](https://travis-ci.org/slack-ruby/danger)
6
+
7
+ ### Setup
8
+
9
+ Enable Danger for a project within the [slack-ruby organization](https://github.com/slack-ruby).
10
+
11
+ #### Set DANGER_GITHUB_API_TOKEN in Travis-CI
12
+
13
+ In Travis-CI, choose _Settings_ and add `DANGER_GITHUB_API_TOKEN` in _Environment Variables_. Set the value to the API key for the [dangerpr-bot](https://github.com/dangerpr-bot) user, look in a recent build for this project for its value.
14
+
15
+ #### Add Danger
16
+
17
+ Add `slack-ruby-danger` to `Gemfile`.
18
+
19
+ ```ruby
20
+ gem 'slack-ruby-danger', '~> 0.1.0'
21
+ ```
22
+
23
+ #### Add Dangerfile
24
+
25
+ Commit a `Dangerfile`, eg. [slack-ruby-client's Dangerfile](https://github.com/slack-ruby/slack-ruby-client/blob/master/Dangerfile).
26
+
27
+ ```ruby
28
+ danger.import_dangerfile(gem: 'slack-ruby-danger')
29
+ ```
30
+
31
+ #### Add Danger to Travis-CI
32
+
33
+ Add Danger to `.travis.yml`, eg. [slack-ruby-client's Travis.yml](https://github.com/slack-ruby/slack-ruby-client/blob/master/.travis.yml).
34
+
35
+ ```yaml
36
+ matrix:
37
+ include:
38
+ - rvm: 2.3.1
39
+ script:
40
+ - bundle exec danger
41
+ ```
42
+
43
+ #### Commit via a Pull Request
44
+
45
+ To test things out make a pull request without CHANGELOG.md changes. Iterate until green.
46
+
47
+ ## License
48
+
49
+ MIT License. See [LICENSE](LICENSE) for details.
50
+
@@ -0,0 +1,65 @@
1
+ # Releasing
2
+
3
+ There're no particular rules about when to release slack-ruby-danger. Release bug fixes frequenty, features not so frequently and breaking API changes rarely.
4
+
5
+ ### Release
6
+
7
+ Run tests, check that all tests succeed locally.
8
+
9
+ ```
10
+ bundle install
11
+ rake
12
+ ```
13
+
14
+ Check that the last build succeeded in [Travis CI](https://travis-ci.org/slack-ruby/slack-ruby-danger) for all supported platforms.
15
+
16
+ Increment the version, modify [lib/slack-ruby-danger/version.rb](lib/slack-ruby-danger/version.rb).
17
+
18
+ * Increment the third number if the release has bug fixes and/or very minor features, only (eg. change `0.7.1` to `0.7.2`).
19
+ * Increment the second number if the release contains major features or breaking API changes (eg. change `0.7.1` to `0.8.0`).
20
+
21
+ Change "Next Release" in [CHANGELOG.md](CHANGELOG.md) to the new version.
22
+
23
+ ```
24
+ ### 0.7.2 (February 6, 2014)
25
+ ```
26
+
27
+ Remove the line with "Your contribution here.", since there will be no more contributions to this release.
28
+
29
+ Commit your changes.
30
+
31
+ ```
32
+ git add CHANGELOG.md lib/slack-ruby-danger/version.rb
33
+ git commit -m "Preparing for release, 0.7.2."
34
+ git push origin master
35
+ ```
36
+
37
+ Release.
38
+
39
+ ```
40
+ $ rake release
41
+
42
+ slack-ruby-danger 0.7.2 built to pkg/slack-ruby-danger-0.7.2.gem.
43
+ Tagged v0.7.2.
44
+ Pushed git commits and tags.
45
+ Pushed slack-ruby-danger 0.7.2 to rubygems.org.
46
+ ```
47
+
48
+ ### Prepare for the Next Version
49
+
50
+ Add the next release to [CHANGELOG.md](CHANGELOG.md).
51
+
52
+ ```
53
+ Next Release
54
+ ============
55
+
56
+ * Your contribution here.
57
+ ```
58
+
59
+ Comit your changes.
60
+
61
+ ```
62
+ git add CHANGELOG.md
63
+ git commit -m "Preparing for next release."
64
+ git push origin master
65
+ ```
@@ -0,0 +1,14 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+
4
+ Bundler.setup :default
5
+
6
+ Bundler::GemHelper.install_tasks
7
+
8
+ require 'rubocop/rake_task'
9
+ RuboCop::RakeTask.new
10
+
11
+ require 'rspec/core/rake_task'
12
+ RSpec::Core::RakeTask.new(:spec)
13
+
14
+ task default: [:rubocop, :spec]
@@ -0,0 +1,3 @@
1
+ module SlackRubyDanger
2
+ VERSION = '0.1.0'.freeze
3
+ end
@@ -0,0 +1,22 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path('../lib', __FILE__)
3
+ require 'slack-ruby-danger/version'
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = 'slack-ruby-danger'
7
+ s.version = SlackRubyDanger::VERSION
8
+ s.authors = ['dblock']
9
+ s.email = ['dblock@dblock.org']
10
+ s.homepage = 'https://github.com/slack-ruby/danger'
11
+ s.summary = 'Danger.systems conventions for slack-ruby projects.'
12
+ s.description = 'Packages a Dangerfile to be used with Danger for projects within the slack-ruby community.'
13
+
14
+ s.files = `git ls-files`.split("\n")
15
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
+ s.require_paths = ['lib']
17
+
18
+ s.add_development_dependency 'rake'
19
+ s.add_development_dependency 'rspec'
20
+ s.add_runtime_dependency 'danger', '~> 3.2.1'
21
+ s.add_runtime_dependency 'danger-changelog', '~> 0.1.0'
22
+ end
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler.require
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe SlackRubyDanger do
4
+ it 'has a version' do
5
+ expect(subject::VERSION).to_not be nil
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,119 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: slack-ruby-danger
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - dblock
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-09-05 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
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
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 3.2.1
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 3.2.1
55
+ - !ruby/object:Gem::Dependency
56
+ name: danger-changelog
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.1.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.1.0
69
+ description: Packages a Dangerfile to be used with Danger for projects within the
70
+ slack-ruby community.
71
+ email:
72
+ - dblock@dblock.org
73
+ executables: []
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - ".gitignore"
78
+ - ".rspec"
79
+ - ".rubocop.yml"
80
+ - ".rubocop_todo.yml"
81
+ - ".travis.yml"
82
+ - CHANGELOG.md
83
+ - CONTRIBUTING.md
84
+ - Dangerfile
85
+ - Gemfile
86
+ - LICENSE
87
+ - README.md
88
+ - RELEASING.md
89
+ - Rakefile
90
+ - lib/slack-ruby-danger/version.rb
91
+ - slack-ruby-danger.gemspec
92
+ - spec/spec_helper.rb
93
+ - spec/version_spec.rb
94
+ homepage: https://github.com/slack-ruby/danger
95
+ licenses: []
96
+ metadata: {}
97
+ post_install_message:
98
+ rdoc_options: []
99
+ require_paths:
100
+ - lib
101
+ required_ruby_version: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ version: '0'
106
+ required_rubygems_version: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ requirements: []
112
+ rubyforge_project:
113
+ rubygems_version: 2.4.8
114
+ signing_key:
115
+ specification_version: 4
116
+ summary: Danger.systems conventions for slack-ruby projects.
117
+ test_files:
118
+ - spec/spec_helper.rb
119
+ - spec/version_spec.rb