Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switched to Omakase Rubocop #4

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions content.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ A style guide provides a coherent set of rules for code formatting and best prac
Linters are tools that help identify issues like syntax errors, stylistic errors, and other potential problems before they become more serious. They play a vital role in maintaining code quality.

## RuboCop 🤖
[RuboCop](https://github.com/rubocop/rubocop) is a static code analyzer for Ruby, based on the [community style guide]((https://rubystyle.guide/)). It can also format code, fixing issues automatically.
[RuboCop-Rails-Omakase](https://github.com/rails/rubocop-rails-omakase) — a specialized form of [RuboCop](https://github.com/rubocop/rubocop) — is a static code analyzer for Ruby, based on the [community style guide]((https://rubystyle.guide/)). It can also format code, fixing issues automatically.

<!--

Expand All @@ -26,13 +26,13 @@ https://github.com/rubocop/rubocop-rails
### Integrating RuboCop
To integrate RuboCop into your Rails project, follow these steps:

1. Add RuboCop to your Gemfile.
1. Add RuboCop-Rails-Omakase to your Gemfile.
```ruby
# only needed in the development environment
group :development do
...
# Set the require option to false, as it is a standalone tool.
gem 'rubocop', require: false
gem "rubocop-rails-omakase", require: false
...
end
```
Expand All @@ -44,13 +44,28 @@ end
```bash
touch .rubocop.yml
```
4. Replace anything already in `.rubocop.yml` with this:
```
inherit_gem:
rubocop-rails-omakase: rubocop.yml

AllCops:
NewCops: enable
Exclude:
- node_modules/**/*
- public/**/*
- vendor/**/*

Style/MixinGrouping:
Enabled: false
```

4. To analyze your project, run:
5. To analyze your project, run:
```bash
rubocop
```

5. To automatically fix issues, run:
6. To automatically fix issues, run:
```bash
rubocop -a
```
Expand Down