{"id":13462975,"url":"https://github.com/rubocop/guard-rubocop","last_synced_at":"2025-05-15T09:05:31.644Z","repository":{"id":8149473,"uuid":"9569306","full_name":"rubocop/guard-rubocop","owner":"rubocop","description":"Guard plugin for RuboCop","archived":false,"fork":false,"pushed_at":"2024-05-20T14:34:40.000Z","size":157,"stargazers_count":262,"open_issues_count":5,"forks_count":54,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-05-11T02:55:10.118Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rubocop.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-04-20T19:17:12.000Z","updated_at":"2025-05-06T18:29:21.000Z","dependencies_parsed_at":"2024-08-10T21:10:28.601Z","dependency_job_id":"9f610eef-8cbf-4f46-9542-221d2ad18c9e","html_url":"https://github.com/rubocop/guard-rubocop","commit_stats":{"total_commits":198,"total_committers":11,"mean_commits":18.0,"dds":"0.10606060606060608","last_synced_commit":"d893134f7c03b0075aa63aca73fb8850c7ae97d5"},"previous_names":["yujinakayama/guard-rubocop"],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubocop%2Fguard-rubocop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubocop%2Fguard-rubocop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubocop%2Fguard-rubocop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubocop%2Fguard-rubocop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rubocop","download_url":"https://codeload.github.com/rubocop/guard-rubocop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253509775,"owners_count":21919587,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T13:00:43.019Z","updated_at":"2025-05-15T09:05:31.606Z","avatar_url":"https://github.com/rubocop.png","language":"Ruby","funding_links":[],"categories":["Code Quality"],"sub_categories":["Code Metrics"],"readme":"[![Gem Version](https://badge.fury.io/rb/guard-rubocop.svg)](http://badge.fury.io/rb/guard-rubocop)\n[![CI](https://github.com/rubocop/guard-rubocop/workflows/CI/badge.svg)](https://github.com/rubocop/guard-rubocop/actions)\n[![Coverage Status](https://coveralls.io/repos/rubocop/guard-rubocop/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/rubocop/guard-rubocop?branch=master)\n[![Code Climate](https://codeclimate.com/github/rubocop/guard-rubocop/badges/gpa.svg)](https://codeclimate.com/github/rubocop/guard-rubocop)\n\n# guard-rubocop\n\n**guard-rubocop** allows you to automatically check Ruby code style with [RuboCop](https://github.com/rubocop/rubocop) when files are modified.\n\nTested on MRI 2.5 - 3.1.\n\n## Installation\n\nPlease make sure to have [Guard](https://github.com/guard/guard) installed before continue.\n\nAdd `guard-rubocop` to your `Gemfile`:\n\n```ruby\ngroup :development do\n  gem 'guard-rubocop'\nend\n```\n\nand then execute:\n\n```sh\n$ bundle install\n```\n\nor install it yourself as:\n\n```sh\n$ gem install guard-rubocop\n```\n\nAdd the default Guard::RuboCop definition to your `Guardfile` by running:\n\n```sh\n$ guard init rubocop\n```\n\n## Usage\n\nPlease read the [Guard usage documentation](https://github.com/guard/guard#readme).\n\n## Options\n\nYou can pass some options in `Guardfile` like the following example:\n\n```ruby\nguard :rubocop, all_on_start: false, cli: ['--format', 'clang', '--rails'] do\n  # ...\nend\n```\n\n### Available Options\n\n```ruby\nall_on_start: true     # Check all files at Guard startup.\n                       #   default: true\ncli: '--rails'         # Pass arbitrary RuboCop CLI arguments.\n                       # An array or string is acceptable.\n                       #   default: nil\ncmd: './bin/rubocop'   # Pass custom cmd to run rubocop.\n                       #   default: rubocop\n\nhide_stdout: false     # Do not display console output (in case outputting to file).\n                       #   default: false\nkeep_failed: true      # Keep failed files until they pass.\n                       #   default: true\nnotification: :failed  # Display Growl notification after each run.\n                       #   true    - Always notify\n                       #   false   - Never notify\n                       #   :failed - Notify only when failed\n                       #   default: :failed\nlaunchy: nil           # Filename to launch using Launchy after RuboCop runs.\n                       #   default: nil\n```\n\n### Using Launchy to view results\n\nguard-rubocop can be configured to launch a results file in lieu of or in addition to outputing results to the terminal.\nConfigure your Guardfile with the launchy option:\n\n``` ruby\nguard :rubocop, cli: %w(--format fuubar --format html -o ./tmp/rubocop_results.html), launchy: './tmp/rubocop_results.html' do\n  # ...\nend\n```\n\n## Advanced Tips\n\nIf you're using a testing Guard plugin such as [`guard-rspec`](https://github.com/guard/guard-rspec) together with `guard-rubocop` in the TDD way (the red-green-refactor cycle),\nyou might be uncomfortable with the offense reports from RuboCop in the red-green phase:\n\n* In the red-green phase, you're not necessarily required to write clean code – you just focus writing code to pass the test. It means, in this phase, `guard-rspec` should be run but `guard-rubocop` should not.\n* In the refactor phase, you're required to make the code clean while keeping the test passing. In this phase, both `guard-rspec` and `guard-rubocop` should be run.\n\nIn this case, you may consider making use of the [group method](https://github.com/guard/guard/wiki/Guardfile-DSL---Configuring-Guard#group) in your `Guardfile`:\n\n```ruby\n# This group allows to skip running RuboCop when RSpec failed.\ngroup :red_green_refactor, halt_on_fail: true do\n  guard :rspec do\n    # ...\n  end\n\n  guard :rubocop do\n    # ...\n  end\nend\n```\n\nNote: You need to use `guard-rspec` 4.2.3 or later due to a [bug](https://github.com/guard/guard-rspec/pull/234) where it unintentionally fails when there are no spec files to be run.\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n## License\n\nCopyright (c) 2013–2020 Yuji Nakayama\n\nSee the [LICENSE.txt](LICENSE.txt) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubocop%2Fguard-rubocop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubocop%2Fguard-rubocop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubocop%2Fguard-rubocop/lists"}