Skip to content

Commit

Permalink
Automatically fix any code style issues (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
frankieroberto authored Jul 19, 2022
1 parent 9dbde4c commit 50df237
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Lint

on: [pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.0
bundler-cache: true
- name: Run linters with autofix
run: bundle exec rubocop --auto-correct-all
- name: Push any fixes
run: |
git config --global user.email "lint-bot"
git config --global user.name "lint-bot"
git add --all
git commit -m "Code style fixes" || exit 0
git push
- name: Re-run linter
run: bundle exec rubocop
6 changes: 3 additions & 3 deletions .github/workflows/main.yml → .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Ruby
name: Tests

on:
push:
Expand All @@ -23,5 +23,5 @@ jobs:
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run the default task
run: bundle exec rake
- name: Run tests
run: bundle exec rspec
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
pkg
.bundle/config
vendor/bundle

0 comments on commit 50df237

Please sign in to comment.