Skip to content

Rubocop Linter Action: A GitHub Action to run Rubocop against your code!

License

Notifications You must be signed in to change notification settings

thedyrt/rubocop-linter-action

 
 

Repository files navigation

Rubocop Tests Build Changelog Version Number All Contributors

✅ Rubocop Linter Action

A GitHub Action to run Rubocop against your code and create annotations in the GitHub UI.

📄 Introduction

GitHub Actions are an amazing new tool that can dramatically improve productivity while using the GitHub platform. While it is not hard to write a custom GitHub action to run Rubocop on your codebase, this action takes that functionality one step further using the checks API. After the Rubocop Linter Action runs Rubocop against your code, it will create annotations that you can easily view, matched up with the offending code.

Since GitHub actions and the checks API are continually changing, it is possible that there will be breaking API changes that affect this action. If so, please open an issue and I will look into it as soon as I can.

💡 Usage

Add the following to your GitHub action workflow to use Rubocop Linter Action:

- name: Rubocop Linter
  uses: andrewmcodes/[email protected]
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

📦 Example Workflow

Here is an example workflow file incorporating Rubocop Linter Action:

name: Rubocop

on: [push]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - name: Rubocop Linter
      uses: andrewmcodes/[email protected]
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

⚠️ Gotchas

Due to the GitHub Check Runs API, we can only return 50 annotations per run. See here for more info.

📸 Screenshots

Rubocop Linter Checks Overview Rubocop Linter File Annotation

🔖 Changelog

View our Changelog

🆘 Contributing

Contributing Guide

🚨 Code of Conduct

Code of Conduct

©️ License

MIT

🥇 Recognition

This project was originally forked from gimenete/rubocop-action. Many thanks to Alberto Gimeno for creating this project.

🤖 Check Out My Other Ruby GitHub Actions

✨ Contributors

Thanks goes to these wonderful people (emoji key):

Andrew Mason
Andrew Mason

🚇 👀 📖 💻
Miguel Savignano
Miguel Savignano

🚇 ⚠️ 💻
Dan McGregor
Dan McGregor

📖
amerritt14
amerritt14

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

About

Rubocop Linter Action: A GitHub Action to run Rubocop against your code!

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 96.0%
  • Dockerfile 2.9%
  • Shell 1.1%