We welcome your contributions to the project. Thank you!
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
This repository, rubocop-github, is part of a broader RuboCop ecosystem.
If the Cop you would like to propose is generally applicable outside of GitHub:
- Propose the change upstream in the core open source project (e.g.
rubocop, orrubocop-rails), where it will have maximal visibility and discussion/feedback. - Patch the change provisionally into GitHub's project(s), for immediate benefit; that can include this repository.
- ...if the proposal is accepted, remove the patch and pull the updated upstream.
- ...if the proposal is not accepted, we usually learn something about our proposal, and we then choose whether to maintain the patch ourselves, discard it, or identify a better open-source home for it.
If the Cop is only applicable for GitHub, then this is the right place to propose it.
- Fork and clone the repository
- Build it and make sure the tests pass on your machine
- Create a new branch:
git checkout -b my-branch-name - Make your change, add tests, and make sure the tests still pass
- Push to your fork and submit a Pull Request
- Pat yourself on the back and wait for your pull request to be reviewed and merged.
Rubocop regularly releases new versions with new cops. We want to keep up to date with the latest Rubocop releases, and keep these rules and styleguide in sync to reduce burden on consumers of this gem.
-
Run
bundle update rubocop rubocop-performance rubocop-railsto update the dependencies within this repository. Major updates will require updating the.gemspecfile because of the pinned version constraints. -
Run
bundle exec rubocop, and copy the output of newly introduced rules intoconfig/default_pending.ymlandconfig/rails_pending.yml. They should look like this:Lint/DuplicateMagicComment: # new in 1.37 Enabled: true Style/OperatorMethodCall: # new in 1.37 Enabled: true Style/RedundantStringEscape: # new in 1.37 Enabled: true
-
Run
bundle exec rubocopagain to ensure that it runs cleanly without any pending cops. Also runbundle exec raketo run the tests. -
Work through the pending cops, and copy them to
config/{default,rails}.ymlwith an explicityEnabled: trueorEnabled: falsedepending on your decision as to whether they should be part of our standard ruleset.
- Update
lib/version.rbwith the next version number - Update the
CHANGELOGwith changes and contributor - Run
bundle installto update gem version contained in the lockfile - Commit your changes and open a pull request
- When the pull request is approved and merged into
main, the.github/workflows/release.ymlworkflow will automatically run to release the new version to RubyGems and GitHub Packages 🎉.