Skip to content

Commit b955d08

Browse files
authored
Added overcommit and loosened Rubocop for tests (#435)
* Added overcommit and loosened Rubocop for tests * Remove documentation from .overcommit.yaml file * Update readme to include overcommit info for contributions
1 parent 9fa5c47 commit b955d08

File tree

6 files changed

+61
-4
lines changed

6 files changed

+61
-4
lines changed

.overcommit.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Use this file to configure the Overcommit hooks you wish to use. This will
2+
# extend the default configuration defined in:
3+
# https://github.com/sds/overcommit/blob/master/config/default.yml
4+
#
5+
# At the topmost level of this YAML file is a key representing type of hook
6+
# being run (e.g. pre-commit, commit-msg, etc.). Within each type you can
7+
# customize each hook, such as whether to only run it on certain files (via
8+
# `include`), whether to only display output if it fails (via `quiet`), etc.
9+
#
10+
# For a complete list of hooks, see:
11+
# https://github.com/sds/overcommit/tree/master/lib/overcommit/hook
12+
#
13+
# For a complete list of options that you can use to customize hooks, see:
14+
# https://github.com/sds/overcommit#configuration
15+
#
16+
# Uncomment the following lines to make the configuration take effect.
17+
18+
PreCommit:
19+
RuboCop:
20+
enabled: true
21+
22+
PostCheckout:
23+
BundleInstall:
24+
enabled: true

.rubocop.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,10 @@ Naming/MethodParameterName:
6060

6161
Naming/VariableNumber:
6262
CheckSymbols: false
63+
Exclude:
64+
- 'test/**'
65+
66+
Metrics/BlockLength:
67+
Exclude:
68+
- 'test/**'
69+

Gemfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1+
# frozen_string_literal: true
2+
13
source "https://rubygems.org"
24

3-
group :test do
5+
group :test, :development do
46
gem "benchmark-ips"
5-
gem "codecov", require: false, group: :test
7+
gem "codecov", :require => false
68
gem "minitest"
79
gem "rake"
810
gem "rubocop"
911
end
12+
13+
group :development do
14+
gem "overcommit"
15+
end

Gemfile.lock

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@ GEM
33
specs:
44
ast (2.4.2)
55
benchmark-ips (2.9.2)
6+
childprocess (4.1.0)
67
codecov (0.6.0)
78
simplecov (>= 0.15, < 0.22)
89
docile (1.4.0)
10+
iniparse (1.5.0)
911
minitest (5.15.0)
12+
overcommit (0.58.0)
13+
childprocess (>= 0.6.3, < 5)
14+
iniparse (~> 1.4)
15+
rexml (~> 3.2)
1016
parallel (1.21.0)
1117
parser (3.1.0.0)
1218
ast (~> 2.4.1)
@@ -41,8 +47,9 @@ DEPENDENCIES
4147
benchmark-ips
4248
codecov
4349
minitest
50+
overcommit
4451
rake
4552
rubocop
4653

4754
BUNDLED WITH
48-
2.0.2
55+
2.3.5

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,19 @@ puts lc_vers.version_string # => "10.10.0"
5656

5757
* Unit and performance testing.
5858

59-
Attribution:
59+
### Contributing, setting up `overcommit` and the linters
60+
61+
In order to keep the repo, docs and data tidy, we use a tool called [`overcommit`](https://github.com/sds/overcommit)
62+
to connect up the git hooks to a set of quality checks. The fastest way to get setup is to run the following to make
63+
sure you have all the tools:
64+
65+
```shell
66+
gem install overcommit bundler
67+
bundle install
68+
overcommit --install
69+
```
70+
71+
### Attribution
6072

6173
* Constants were taken from Apple, Inc's
6274
[`loader.h` in `cctools/include/mach-o`](https://opensource.apple.com/source/cctools/cctools-973.0.1/include/mach-o/loader.h.auto.html).

ruby-macho.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ Gem::Specification.new do |s|
1313
s.required_ruby_version = ">= 2.6"
1414
s.homepage = "https://github.com/Homebrew/ruby-macho"
1515
s.license = "MIT"
16+
s.metadata["rubygems_mfa_required"] = "true"
1617
end

0 commit comments

Comments
 (0)