Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/standardrb/standard-rails
A Standard Ruby plugin that configures rubocop-rails
https://github.com/standardrb/standard-rails
rails ruby standardrb
Last synced: 3 months ago
JSON representation
A Standard Ruby plugin that configures rubocop-rails
- Host: GitHub
- URL: https://github.com/standardrb/standard-rails
- Owner: standardrb
- License: mit
- Created: 2023-03-26T22:26:40.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-29T17:45:49.000Z (3 months ago)
- Last Synced: 2024-08-05T16:58:46.238Z (3 months ago)
- Topics: rails, ruby, standardrb
- Language: Ruby
- Homepage:
- Size: 101 KB
- Stars: 154
- Watchers: 10
- Forks: 14
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# standard-rails
This gem provides a [lint_roller](https://github.com/standardrb/lint_roller)
plugin configuration for the
[rubocop-rails](https://github.com/rubocop/rubocop-rails) ruleset, for use
as an extension to the [Standard Ruby
gem](https://github.com/standardrb/standard).## Usage
First, if you haven't already, get your app set up to [run with the `standard`
gem](https://github.com/standardrb/standard#usage)Next, to add the `standard-rails` plugin, you'll want to start by adding it to your Gemfile:
```ruby
gem "standard-rails", group: [:development, :test]
```Next, in your [`.standard.yml` file](https://github.com/standardrb/standard#yaml-options),
list `standard-rails` as a plugin:```yaml
plugins:
- standard-rails
```## Configuration
Even though it'll usually be inferred automatically, you can specify the exact
version of Rails you want the rules to be run against like this:```yaml
plugins:
- standard-rails:
target_rails_version: 7.0
```### Ignoring violations from old migrations
Rails migrations are intended to be written as forward-compatible and subsequently unchanged, but they may contain Standard Ruby violations. Rather than apply fixes to those old migrations (and risk changing their behavior), you can ignore them in your `.standard.yml` like this:
```ruby
ignore:
# Legacy migrations
- 'db/migrate/201*.rb'
- 'db/migrate/2020*.rb'
- 'db/migrate/2021*.rb'
- 'db/migrate/2022*.rb'
- 'db/migrate/2023*.rb'
```## Code of Conduct
This project follows Test Double's [code of
conduct](https://testdouble.com/code-of-conduct) for all community interactions,
including (but not limited to) one-on-one communications, public posts/comments,
code reviews, pull requests, and GitHub issues. If violations occur, Test Double
will take any action they deem appropriate for the infraction, up to and
including blocking a user from the organization's repositories.