Skip to content

Commit

Permalink
Merge pull request #52 from dblock/misc
Browse files Browse the repository at this point in the history
Added Danger, PR linter.
  • Loading branch information
dblock committed Nov 21, 2016
2 parents 776014d + b2f1fdc commit 902513f
Show file tree
Hide file tree
Showing 22 changed files with 426 additions and 228 deletions.
6 changes: 6 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
AllCops:
Exclude:
- vendor/**/*
- bin/**/*

inherit_from: .rubocop_todo.yml
51 changes: 51 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2016-11-21 14:41:24 -0500 using RuboCop version 0.43.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 3
Metrics/AbcSize:
Max: 22

# Offense count: 1
Metrics/CyclomaticComplexity:
Max: 7

# Offense count: 9
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
# URISchemes: http, https
Metrics/LineLength:
Max: 113

# Offense count: 1
# Configuration parameters: CountComments.
Metrics/MethodLength:
Max: 11

# Offense count: 1
Style/AccessorMethodName:
Exclude:
- 'spec/models/address.rb'

# Offense count: 3
Style/ClassVars:
Exclude:
- 'lib/mongoid/geospatial.rb'

# Offense count: 3
Style/Documentation:
Exclude:
- 'spec/**/*'
- 'test/**/*'
- 'bench/bench'

# Offense count: 4
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes.
# SupportedStyles: slashes, percent_r, mixed
Style/RegexpLiteral:
Exclude:
- 'Guardfile'
38 changes: 17 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
sudo: false

language: ruby
bundler_args: --without development
rvm:
- 1.9.3
- 2.0.0
- 2.1.0
- 2.2.0
- ruby-head
- jruby
- jruby-head
- rbx-2

jdk:
- oraclejdk7
- openjdk7
cache: bundler

env: CI="travis" JRUBY_OPTS="--server -Xcompile.invokedynamic=false -J-XX:+TieredCompilation -J-XX:TieredStopAtLevel=1 -J-noverify -J-Xms512m -J-Xmx1024m"
services: mongodb

rvm:
- 2.3.1

matrix:
allow_failures:
- rvm: ruby-head
- rvm: jruby-head
before_install:
- gem update bundler

services:
- mongodb
before_script:
- bundle exec danger

sudo: false
addons:
apt:
sources:
- mongodb-3.2-precise
packages:
- mongodb-org-server
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## 5.1.0 (Next)

* [#52](https://github.com/mongoid/mongoid-geospatial/pull/52): Added Danger and Rubocop, PR and code linters - [@dblock](https://github.com/dblock).
* Your contribution here.

## 5.0.0 (2015/07/23)

* Mongoid 5 support - [@nofxx](https://github.com/nofxx).

## 4.0.1 (2015/03/04)

## 4.0.0 (2015/01/11)

* Mongoid 4 support - [@nofxx](https://github.com/nofxx).

## 3.9.0 (2014/12/22)

* Initial public release - [@nofxx](https://github.com/nofxx).
118 changes: 118 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
Contributing to Mongoid::Geospatial
===================================

Mongoid::Geospatial is work of [many of contributors](https://github.com/mongoid/mongoid-geospatial/graphs/contributors). You're encouraged to submit [pull requests](https://github.com/mongoid/mongoid-geospatial/pulls), [propose features, ask questions and discuss issues](https://github.com/mongoid/mongoid-geospatial/issues).

#### Fork the Project

Fork the [project on Github](https://github.com/mongoid/mongoid-geospatial) and check out your copy.

```
git clone https://github.com/contributor/mongoid-geospatial.git
cd mongoid-geospatial
git remote add upstream https://github.com/mongoid/mongoid-geospatial.git
```

#### Create a Topic Branch

Make sure your fork is up-to-date and create a topic branch for your feature or bug fix.

```
git checkout master
git pull upstream master
git checkout -b my-feature-branch
```

#### Bundle Install and Test

Ensure that you can build the project and run tests.

```
bundle install
bundle exec rake
```

#### Write Tests

Try to write a test that reproduces the problem you're trying to fix or describes a feature that you want to build. Add to [spec/mongoid-geospatial](spec/mongoid-geospatial).

We definitely appreciate pull requests that highlight or reproduce a problem, even without a fix.

#### Write Code

Implement your feature or bug fix.

Ruby style is enforced with [Rubocop](https://github.com/bbatsov/rubocop), run `bundle exec rubocop` and fix any style issues highlighted.

Make sure that `bundle exec rake` completes without errors.

#### Write Documentation

Document any external behavior in the [README](README.md).

#### Update Changelog

Add a line to [CHANGELOG](CHANGELOG.md) under *Next Release*. Make it look like every other line, including your name and link to your Github account.

#### Commit Changes

Make sure git knows your name and email address:

```
git config --global user.name "Your Name"
git config --global user.email "contributor@example.com"
```

Writing good commit logs is important. A commit log should describe what changed and why.

```
git add ...
git commit
```

#### Push

```
git push origin my-feature-branch
```

#### Make a Pull Request

Go to https://github.com/contributor/mongoid-geospatial and select your feature branch. Click the 'Pull Request' button and fill out the form. Pull requests are usually reviewed within a few days.

#### Rebase

If you've been working on a change for a while, rebase with upstream/master.

```
git fetch upstream
git rebase upstream/master
git push origin my-feature-branch -f
```

#### Update CHANGELOG Again

Update the [CHANGELOG](CHANGELOG.md) with the pull request number. A typical entry looks as follows.

```
* [#123](https://github.com/mongoid/mongoid-geospatial/pull/123): Reticulated splines - [@contributor](https://github.com/contributor).
```

Amend your previous commit and force push the changes.

```
git commit --amend
git push origin my-feature-branch -f
```

#### Check on Your Pull Request

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.

#### Be Patient

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!

#### Thank You

Please do know that we really appreciate and value your time and work. We love you, really.
1 change: 1 addition & 0 deletions Dangerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
danger.import_dangerfile(gem: 'mongoid-danger')
20 changes: 10 additions & 10 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ gemspec # Specify gem's dependencies in mongoid_geospatial.gemspec

gem 'rake'

group :test do
group :development, :test do
gem 'pry'
gem 'yard'
gem 'nokogiri'

gem 'dbf'
gem 'rgeo'
gem 'georuby'

gem 'rspec'

gem 'rubocop'
gem 'fuubar'
gem 'guard'
gem 'guard-rubocop'
gem 'guard-rspec'
end

group :test do
gem 'nokogiri'
gem 'dbf'
gem 'rgeo'
gem 'georuby'
gem 'rspec'
gem 'coveralls', require: false if ENV['CI']
gem 'mongoid-danger', '~> 0.1.0', require: false
gem 'rubocop', '0.45.0'
end
4 changes: 2 additions & 2 deletions Guardfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ end

guard :rspec, cmd: 'bundle exec rspec', notification: true do
watch(/^spec\/.+_spec\.rb$/)
watch(/^lib\/(.+)\.rb$/) { |m| "spec/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { 'spec' }
watch(/^lib\/(.+)\.rb$/) { |m| "spec/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { 'spec' }
end
4 changes: 2 additions & 2 deletions MIT-LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2009-2015 Mongoid Geospatial Authors
Copyright (c) 2009-2016 Mongoid Geospatial Authors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand All @@ -17,4 +17,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 comments on commit 902513f

Please sign in to comment.