X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/d43315f738a415823c42e4b7d3df83c1d3aa9263..6f9b0c2f6b187a1787e195cd0d768c5fca1cd839:/CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 43b74224f..5a2ed5ab7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,15 +3,16 @@ ## 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 rake eslint +bundle exec erblint . +``` ## Testing @@ -54,6 +55,13 @@ might be difficult to understand what the code does, why it does it and why it should be the way it is. * Check existing comments to ensure that they are not misleading. +## i18n + +If you make a change that involve the locale files (in `config/locales`) then please +only submit changes to the `en.yml` file. The other files are updated via +[Translatewiki](https://translatewiki.net/wiki/Translating:OpenStreetMap) and should +not be included in your pull request. + ## Code Documentation To generate the HTML documentation of the API/rails code, run the command