X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/a2c7c09f7cdee569d5b8709c96aded33e398726b..49fc17c6b6f60eba8737fcde85bd679d1b6de8c1:/CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 961377ec8..c5a636569 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,17 +1,17 @@ -* http://www.ruby-lang.org/ - The homepage of Ruby which has more links and some great tutorials. +* https://www.ruby-lang.org/ - The homepage of Ruby which has more links and some great tutorials. * http://rubyonrails.org/ - The homepage of Rails, also has links and tutorials ## Coding style -When writing code it is generally a good idea to try and match your -formatting to that of any existing code in the same file, or to other -similar files if you are writing new code. Consistency of layout is -far more important than the layout itself as it makes reading code -much easier. +We use [Rubocop](https://github.com/rubocop-hq/rubocop) (for ruby files) +and [ERB Lint](https://github.com/Shopify/erb-lint) (for erb templates) +to help maintain consistency in our code. You can run these utilities during +development to check that your code matches our guidelines: -One golden rule of formatting -- please don't use tabs in your code -as they will cause the file to be formatted differently for different -people depending on how they have their editor configured. +``` +bundle exec rubocop +bundle exec erblint . +``` ## Testing @@ -35,12 +35,7 @@ You can run the existing test suite with: bundle exec rake test ``` -You can generate test coverage stats with: - -``` -sudo gem install rcov -rcov -x gems test/*/*.rb -``` +You can view test coverage statistics by browsing the `coverage` directory. The tests are automatically run on Pull Requests and other commits with the results shown on [Travis CI](https://travis-ci.org/openstreetmap/openstreetmap-website). @@ -94,6 +89,6 @@ If you have forked on GitHub then the best way to submit your patches is to push your changes back to GitHub and then send a "pull request" on GitHub. Otherwise you should either push your changes to a publicly visible git repository -and send the details to the [rails-dev](http://lists.openstreetmap.org/listinfo/rails-dev) +and send the details to the [rails-dev](https://lists.openstreetmap.org/listinfo/rails-dev) list or generate patches with `git format-patch` and send them to the -[rails-dev](http://lists.openstreetmap.org/listinfo/rails-dev) list. +[rails-dev](https://lists.openstreetmap.org/listinfo/rails-dev) list.