Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added overcommit and loosened Rubocop for tests #435

Merged
merged 4 commits into from
Jan 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .overcommit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Use this file to configure the Overcommit hooks you wish to use. This will
# extend the default configuration defined in:
# https://github.com/sds/overcommit/blob/master/config/default.yml
#
# At the topmost level of this YAML file is a key representing type of hook
# being run (e.g. pre-commit, commit-msg, etc.). Within each type you can
# customize each hook, such as whether to only run it on certain files (via
# `include`), whether to only display output if it fails (via `quiet`), etc.
#
# For a complete list of hooks, see:
# https://github.com/sds/overcommit/tree/master/lib/overcommit/hook
#
# For a complete list of options that you can use to customize hooks, see:
# https://github.com/sds/overcommit#configuration
#
# Uncomment the following lines to make the configuration take effect.
woodruffw marked this conversation as resolved.
Show resolved Hide resolved

PreCommit:
RuboCop:
enabled: true
woodruffw marked this conversation as resolved.
Show resolved Hide resolved

PostCheckout:
BundleInstall:
enabled: true
woodruffw marked this conversation as resolved.
Show resolved Hide resolved
7 changes: 7 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,10 @@ Naming/MethodParameterName:

Naming/VariableNumber:
CheckSymbols: false
Exclude:
- 'test/**'

Metrics/BlockLength:
Exclude:
- 'test/**'
woodruffw marked this conversation as resolved.
Show resolved Hide resolved

10 changes: 8 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# frozen_string_literal: true

source "https://rubygems.org"

group :test do
group :test, :development do
gem "benchmark-ips"
gem "codecov", require: false, group: :test
woodruffw marked this conversation as resolved.
Show resolved Hide resolved
gem "codecov", :require => false
gem "minitest"
gem "rake"
gem "rubocop"
end

group :development do
woodruffw marked this conversation as resolved.
Show resolved Hide resolved
gem "overcommit"
end
9 changes: 8 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@ GEM
specs:
ast (2.4.2)
benchmark-ips (2.9.2)
childprocess (4.1.0)
codecov (0.6.0)
simplecov (>= 0.15, < 0.22)
docile (1.4.0)
iniparse (1.5.0)
minitest (5.15.0)
overcommit (0.58.0)
childprocess (>= 0.6.3, < 5)
iniparse (~> 1.4)
rexml (~> 3.2)
parallel (1.21.0)
parser (3.1.0.0)
ast (~> 2.4.1)
Expand Down Expand Up @@ -41,8 +47,9 @@ DEPENDENCIES
benchmark-ips
codecov
minitest
overcommit
rake
rubocop

BUNDLED WITH
2.0.2
2.3.5
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,19 @@ puts lc_vers.version_string # => "10.10.0"

* Unit and performance testing.

Attribution:
### Contributing, setting up `overcommit` and the linters

In order to keep the repo, docs and data tidy, we use a tool called [`overcommit`](https://github.com/sds/overcommit)
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
sure you have all the tools:

```shell
gem install overcommit bundler
woodruffw marked this conversation as resolved.
Show resolved Hide resolved
bundle install
overcommit --install
```

### Attribution

* Constants were taken from Apple, Inc's
[`loader.h` in `cctools/include/mach-o`](https://opensource.apple.com/source/cctools/cctools-973.0.1/include/mach-o/loader.h.auto.html).
Expand Down
1 change: 1 addition & 0 deletions ruby-macho.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ Gem::Specification.new do |s|
s.required_ruby_version = ">= 2.6"
s.homepage = "https://github.com/Homebrew/ruby-macho"
s.license = "MIT"
s.metadata["rubygems_mfa_required"] = "true"
woodruffw marked this conversation as resolved.
Show resolved Hide resolved
end