Skip to content

Commit

Permalink
README
Browse files Browse the repository at this point in the history
  • Loading branch information
dbackeus committed Jul 5, 2023
1 parent 65c3b70 commit 3624eea
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 2 deletions.
51 changes: 50 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,55 @@
# rubocop-action

This GitHub action runs rubocop and posts offences as inline comments on the pull request. When offences are resolved the comments are fully deleted, making for clean pull requests without leaving a noisy history behind.
This GitHub action runs rubocop and posts offences as inline comments on pull requests. When offences are resolved, the comments are fully deleted, making for clean pull requests without noisy history.

This action was created to replace the unmaintained [Hound](https://houndci.com/) service from Thoughtbot.

## Usage

Create a `.github/workflows/rubocop.yml` file in your repository:

```yaml
name: Rubocop

on: pull_request

permissions:
contents: read
pull-requests: write

jobs:
rubocop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
- uses: reclaim-the-stack/rubocop-action@v1
```
### Configuration
#### `github_token`

The GitHub token to use for interacting with the GitHub API (eg. to managed comments). By default we use the token which is automatically provided by GitHub Actions.

#### `gem_versions`

By default `rubocop` / `rubocop-rails` and `rubocop-rspec` gems are installed. Check the [action.yml](action.yml) file for the current default version of the gems installed by this action.

You can override the gems and versions either by:

Specifying `gem_versions` as `Gemfile` in which case we parse your `Gemfile.lock` and install any gems with a name beginning with `rubocop` with their specified version.

```yaml
- uses: reclaim-the-stack/rubocop-action@v1
with:
gem_versions: Gemfile
```

Specifying `gem_versions` in the standard `gem install` format.

```yaml
- uses: reclaim-the-stack/rubocop-action@v1
with:
gem_versions: rubocop:1.18.3 rubocop-rspec:2.0.0 rubocop-<some-other-plugin>:1.2.0
```
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Rubocop
name: Reclaim The Stack - Rubocop
description: Runs rubocop and posts offences as inline PR comments.
inputs:
github_token:
Expand Down

0 comments on commit 3624eea

Please sign in to comment.