Reek
Ruby style guide
Reek | Ruby style guide | |
---|---|---|
6 | 36 | |
3,982 | 16,388 | |
- | 0.1% | |
8.1 | 6.0 | |
about 1 month ago | 14 days ago | |
Ruby | ||
MIT License | - |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Reek
-
First commits in a Ruby on Rails app
Rubycritic uses reek under the hood so I added a reek config files at .reek.yml with the following content:
-
Code Reviewing a Ruby on Rails application.
Reek is a code smell detection tool for Ruby that helps identify potential design issues. It analyzes your codebase and provides feedback on areas that might benefit from refactoring or improvement. Here's an overview of what Reek is and how to use it:
-
Improve Code in Your Ruby Application with RubyCritic
$ reek app/controllers/erp/orders_controller.rb Inspecting 1 file(s): S app/controllers/erp/orders_controller.rb -- 1 warning: [91]:UncommunicativeVariableName: Erp::OrdersController#create has the variable name 'e' [https://github.com/troessner/reek/blob/v6.1.1/docs/Uncommunicative-Variable-Name.md]
-
Gems that can identify churn, complexity, duplication and smells.
reek
-
Security Risks On Rails: Misconfiguration and Unsafe Integrations
Other useful gems you may take a look at are dawnscanner, reek, and hakiri_toolbelt.
-
The best way to review my code for code smells?
Beside RuboCop, I found reek very useful. https://github.com/troessner/reek
Ruby style guide
-
An Introduction to RuboCop for Ruby on Rails
By default, RuboCop will enforce the style defined in the Ruby Community Style Guide. We can tailor it to our specific tastes and context, but let's rely on this basic set of rules to learn how to use RuboCop.
-
Code Reviewing a Ruby on Rails application.
RuboCop is a Ruby static code analyzer (a.k.a. linter) and code formatter. Out of the box it will enforce many of the guidelines outlined in the community Ruby Style Guide. Apart from reporting the problems discovered in your code, RuboCop can also automatically fix many of them for you.
- Naming conventions and style guides in programming"
-
Shine bright like a.. Ruby 💎
Read more about Ruby.
-
10 Best Practices for Ruby Programmers: Tips for Efficient, Maintainable, and Bug-Free Code
8. Use a consistent style: Consistency is key when it comes to writing readable code. Use a consistent style throughout your codebase, and follow common Ruby style guides like Ruby Style Guide.
-
It's Official: the Standard Ruby VS Code extension
The real standard is to use default rubocop configuration which is based on https://rubystyle.guide/.
-
Why I think we should adopt and use new Ruby features
It used to, before recently. It literally said, "The and and or keywords are banned."
-
Rubyme: My minimalist Ruby Handbook
rubocop/ruby-style-guide
-
Development guidelines
As you see - there are no reference to any technology or framework. There are a lot of best-practices for almost any framework, so you can choose an appropriate one. For example - if you're a rails developer, then you can check https://github.com/rubocop/ruby-style-guide and https://github.com/rubocop/rails-style-guide but if you're a golang developer - https://github.com/uber-go/guide/blob/master/style.md and https://developers.mattermost.com/contribute/more-info/server/style-guide/
- `and` and `or` control flow operators now allowed in Rubocop
What are some alternatives?
Rubocop - A Ruby static code analyzer and formatter, based on the community Ruby style guide. [Moved to: https://github.com/rubocop/rubocop]
Rails style guide - A community-driven Ruby on Rails style guide
Flay - Flay analyzes code for structural similarities. Differences in literal values, variable, class, method names, whitespace, programming style, braces vs do/end, etc are all ignored.
RSpec style guide - RSpec Best Practices
rails_best_practices - a code metric tool for rails projects
fast-ruby - :dash: Writing Fast Ruby :heart_eyes: -- Collect Common Ruby idioms.
Rubycritic - A Ruby code quality reporter
Fundamental Ruby - :books: Fundamental programming with ruby examples and references. It covers threads, SOLID principles, design patterns, data structures, algorithms. Books for reading. Repo for website https://github.com/khusnetdinov/betterdocs
Flog - Flog reports the most tortured code in an easy to read pain report. The higher the score, the more pain the code is in.
Best-Ruby - Ruby Tricks, Idiomatic Ruby, Refactoring and Best Practices
Brakeman - A static analysis security vulnerability scanner for Ruby on Rails applications
contracts.ruby - Contracts for Ruby.