hpi-swt2 / workshop-portal

A Ruby on Rails app to manage workshops
http://workshopportal.herokuapp.com/
MIT License
21 stars 13 forks source link

Add coding style guide #636

Closed querenker closed 6 years ago

querenker commented 7 years ago

I think this community driven coding style guide looks promising. There is also good tool support for example to comment automatically on style violations in GitHub pull requests. Is it worth a try?

annkatrinkuessner commented 7 years ago

There's also rubocop which is nice for code analyzation and also based on the ruby style guidelines. It is for example used by the openHPI project and is quite nice to use

querenker commented 7 years ago

@annkatrinkuessner Thanks for the fast reply. I think Hound actually uses RuboCop (https://houndci.com/configuration#ruby).

annkatrinkuessner commented 7 years ago

btw: rubocop is already included in the gemfile. only a .rubocop.yml is missing to set houndci and/or rubocop up :)

querenker commented 7 years ago

There is even a codeclimate config which uses rubocop. After adding this repo to codeclimate it should be possible to integrate this analysis into the PR workflow (@bjrne you should have received a request for approval by email). Running rubocop locally should already work but there are a lot of offenses.... 222 files inspected, 4865 offenses detected

bjrne commented 7 years ago

Actually I didn't @querenker, but that may have to do with m email settings. Sadly I didn't get any notification either. I tried my best on codeclimate, it should work now, but I'm not sure. It's also not so easy to filter on rubocop messages, we might want to change our config for this purpose.

querenker commented 7 years ago

@bjrne It seems to work 👍 At least PR #640 has a codeclimate check. What's the purpose for filtering on rubocop messages? Currently there is additional a check for duplicates and a Rails security scanner. For developers it shouldn't be important which specific engine complains, because every problem should be fixed ;) If there is a false positive it can be discussed with the others and for this specific case (or in generell) deactivated in codeclimate.