Skip to content

Instantly share code, notes, and snippets.

@samzhab
samzhab / rubocop.yml
Last active March 17, 2021 03:03 — forked from pdxwolfy/rubocop.yml
# Common configuration.
AllCops:
# Include common Ruby source files.
Include:
- '**/*.gemspec'
- '**/*.podspec'
- '**/*.jbuilder'
- '**/*.rake'
- '**/*.opal'
- '**/config.ru'
@samzhab
samzhab / rubocop_pre_commit_hook
Created March 16, 2021 15:50 — forked from mpeteuil/rubocop_pre_commit_hook
Ruby style guide git pre-commit hook using Rubocop as the style guide checker. Only runs on staged ruby files that have been added and/or modified.
#!/usr/bin/env ruby
require 'English'
require 'rubocop'
ADDED_OR_MODIFIED = /A|AM|^M/.freeze
changed_files = `git status --porcelain`.split(/\n/).
select { |file_name_with_status|
file_name_with_status =~ ADDED_OR_MODIFIED

Keybase proof

I hereby claim:

  • I am samzhab on github.
  • I am ayele (https://keybase.io/ayele) on keybase.
  • I have a public key whose fingerprint is BAE6 519F 408E 0649 6EFA ED35 A615 05E2 4D24 C3F5

To claim this, I am signing this object: